main() function

Advertisements

Function in C Printf and Scanf in C

main() function in C

main() function is the entry point of any C program. It is the point at which execution of program is started. When a C program is executed, the execution control goes directly to the main() function. Every C program have a main() function.

main function in c

Syntax of Main Function in C

 void main()
 {
  .........
  .........
 }

In above syntax;

  • void: is a keyword in C language, void means nothing, whenever we use void as a function return type then that function nothing return. here main() function no return any value.
  • In place of void we can also use int return type of main() function, at that time main() return integer type value.
  • main: is a name of function which is predefined function in C library.

Simple example of main()

Example of Main Function in C

#include<stdio.h>

void main()
{
printf("This is main function");
}

Output

This is main function

Function in C Printf and Scanf in C

Google Advertisment

Buy This Ad Space @$20 per Month, Ad Size 600X200 Contact on: hitesh.xc@gmail.com or 9999595223

Magenet is best Adsense Alternative here we earn $2 for single link, Here we get links ads. Magenet

For Projects 9999595223

Google Advertisements


Buy Websites 9999595223

Buy College Projects with Documentation Contact on whatsapp 9999595223. Contact on: hitesh.xc@gmail.com or 9999595223 Try this Keyword C++ Programs

Advertisements