Let us look at structure of a C program
A C program consist of following parts:
Let us look at a simple code that would print "Hello World"
#include <stdio.h>
int main() {
/* First C program */
printf("Hello World");
return 0;
}
Now, Take a look at various parts of program...
- First line of program
#include <stdio.h>
is a preprocessor command, that tells the C compiler to include stdio.h file before actual compilation. - Next line
int main()
is the main function. It is the beginning of a program execution. - Next line
/*....*/
will be ignored by compiler. These lines are called comments. - The next line
printf(...)
is a function that prints the message. - The next line
return 0;
terminates the main function and return the value 0.
0 Comments