Let's see one simple example of C program and learn some basic syntax of it.
#include <stdio.h>
int main() {
printf("Hello World!");
return 0;
}
Line 1: #include <stdio.h> is a statement to include the header file library.
<stdio.h> is a library that lets us work with input and output functions, such as printf().
Line 2: blank space. C ignores white space, but we need white spaces to increase our code readability.
Line 3: the main() function. As its name implies, main() function consists of the main code to be executed.
Any code inside the curly brackets { } is called “inside the main() function”
Line 4: printf() is a function used to output or print text to the screen.
Line 5: return 0; ends the main() function.
Note: every C statement ends with a semicolon (;)