Essential parts of a C language program. Pre-processor Header file Function Variables Statements & expressions Comments
We have learned about the following topics so far:
To understand these topics better, lets discuss first C program examples.
Program to Display "Hello, World!"
#include <stdio.h>
int main()
{
printf("Hello,World"); //single line comment
return 0;
/*
multi
line
comments
/*
}
Output
Hello, World!
How "Hello, World!" program works?
The stdio.h file contains functions such as scanf() and print() to take input and display output respectively.
If you use printf() function without writing #include <stdio.h>, the program will not be compiled.