The main function

The main function :

The main function is a part of every C program. C Permits different froms of main statement.

Following froms are allowed :


  • main() 
  • int main() 
  • void main() 
  • main(void) 
  • void main(void) 
  • int main(void) 


The empty pair of parentheses indicates that the function has no arguments. This may be explicitly indicated by using the keyword void inside the parentheses. We may also specify the keyword int or void before the word main. The keyword void means that the function does not return any information to the operating system and int means that the function returns an integer value to the operating system. When int is specified, the last statement in the program must be "return 0".

Comments

Popular posts from this blog

Addition 2 number in C Language

Input and Output in C

Comments in C