C Program to display " hello world "
#include
int main()
{
// printf() displays the string inside quotation
printf("Hello, World!");
return 0;
}
Output
Hello, World!
How "hello world" program works ?
- The #include is preprocessor command that tells the compiler to include the content of stdio.h ( Standard input and output ) file in the program.
- The stdio.h file contains function such as scanf() and print() to takee input and display output respectively.
- If you see the printf() function without writing #include<stdio.h>, the program will ot be compiled.
- The execution of C program starts from the main() function.
- printf() is a library function to send formatted output to the screen. In this program, printf() display hello world to the screen.
- The return 0; statement is the Execution of the program. In simple terms. The program ends with this statement.
0 comments:
Post a Comment