C Program Structure

 

#include <stdio.h>
main()
{
     /* My first program */
     printf("Hello World! \n");
}

 

C Language is case sensitive. All commands should be in lowercase. End of each statement must be marked with a semicolon.

Starting point of any program is identified by word main(). This means where the program actually starts.

Two braces { and } means the begin and end of the segment. (blocks of statements) (1)

#include<stdio.h> is to allow the use of printf statement in program. Stdio.h is header file –  header file contains definitions of functions and variables. #include is a preprocess command that includes header files before compiling a C program.

printf() is a function / procedure in C Language used to print variable or text.

Comments can be inserted into C programs by bracketing text with the /* and */ delimiters. Whatever comes inside the command won’t be considered for compilation and execution. Used for internal documentation.

C Compilation Code

compilationmodel

 

 

 

 

Advertisements