C Syntax
We have already seen the following code in the last chapter, now we will learn line by line this code.
#include
<stdio.h>
int
main()
{
printf("Hello Coders!");
return
0;
}
Explained each line of this code
#include
<stdio.h>
This preprocessor tells the compiler to include the stdio.h library containing input and output functions such as printf.
int
main()
The primary purpose is to act as the interface for all C programs. The term "int" symbol represents that the function returns an integer, which is frequently used to indicate whether an error happened or the program executed successfully.
{
This is the first brace, indicating the start of the main body.
printf("Hello Coders!");
This is the initial brace, which signals the beginning of the body. The printf prints output to the console. In this case, it prints the string "Hello Coders!" to the screen. The ; at the end marks the end of the statement.
return
0;
This command prints the value 0 to the console and ends the main method. Normally, a return value of 0 signifies that the program executed successfully.
}
This final closing brace indicates that the main function is complete.