Sunday, 25 December 2016

Structure of C program


1. /* This program........ */
The symbols /*........*/ used for comments. This comment are ignored by the compiler, and are used to provide useful information about program to humans who use it.

2. #include
This is a preprocessor which tells compiler to include stdio.h file.

3. main()
C programs consists of one or more functions. There must be one and only one main function. The brackets following the word main indicate that it is a function and not a variable.

4. { }
Braces surround the body of the function, which may have one or more instructions/statements.

5. printf()
It is a library function that is used to print data on the user screen.

6. "Hello World\n" is a string that will be displayed on user screen.
\n is the newline character.
; a semicolon ends a statement.

7. return 0;
 return the value zero to the Operating System.

NOTE: C is a case sensitive language, so the names of the functions must be typed in lower case as above. C programs are saved with .c extension.


No comments:

Post a Comment