First program in C language.
<stdio.h> std - standard library, i - input, o- output, h- header.
The main function serves as the starting point for program
execution. It usually controls program execution by directing the calls to
other functions in the program.
#include <stdio.h>
int main()
{
// Displays the
string inside quotations
printf("C
Program");
return 0;
}
Output
C Program
How does this program work?
All valid C programs must contain the main() function. The
code execution begins from the start of the main() function.
The printf() is a library function to send formatted output
to the screen. The function prints the string inside quotations.
To use printf() in our program, we need to include stdio.h
header file using the #include <stdio.h> statement.
The return 0; statement inside the main() function is the
"Exit status" of the program. It's optional.
0 Comments