Lets print “Hello C” as the first C program and than understand it in detail.
#include <stdio.h> void main() { printf ("Hello C!"); } |
Output
Hello C! |
Description:
#include <stdio.h> :
“#include” is a preprocessor directive used to include a library file in the code. The header file “stdio.h” is included in the source code to use the pre-defined functions “printf” and “scanf”.
void main() :
Void represents the data type of the main function which is a must for every C program.
{} :
{} represents the opening and closing of the main function.
printf (“Hello C!”); :
The printf function outputs the string on the console screen.
Compilation and Execution:
Click on Compile menu and then on Run menu or click ctrl+F9 directly, both for compile and run.