regarding c programming is semicolon used after function name is declared and why?
There are 3 points to be followed for a function in order.Declaration,Definition and Execution.Since C follows a top down approach,so u need to first declare the function in an exact form as when u define it.This is merely a statement which tells the compiler that it is going to encounter this function in the following statements of the program.This declaration statement is known as Prototype Declaration.Since in C statements are followed by semicolon.Hence,it is used..If you don't want to declare the function separately,just define it before the function which calls this particular function..In that case u should not put the semicolon,since that would be the definition of the function...
Semicolon simply indicates the end of the statement .... by defining a prototype you would tell the compiler of the existence of the function before calling it.
Join our real-time social learning platform and learn together with your friends!