Smile

Sunday, August 14, 2011

Sample C program


Explanation
---------------
//
This is used for single line comment. This portion will not be executed.

/* */
This is used for multiple line comments. This portion will not be executed.

#include<stdio.h> or #include"stdio.h"

#-----> preprocessor directive
stdio.h----> standard input output header file
If header file included between < > , C linker searches header file in predefined library section.
If header file included between " " , C linker searches header file in both predefined library section and user defined library section.

#include<conio.h> or #include"conio.h"
This is console input output header file.

void main()
void--------> This is return type of function means nothing to return.
main()------> This is main function. The execution of C program starts from here. This is mandatory. Without this program returns error.

{ }
Body of the function to be executed. The portion enclosed between {} is said to be block.



No comments:

Post a Comment