Hello World - First Program
What is Program ?
Program is a set of instructions which can be executed in a specific sequence to get the desired output.
Hello World Program is the First Program- hello.c
Program:
Program is a set of instructions which can be executed in a specific sequence to get the desired output.
Hello World Program is the First Program- hello.c
Program:
#include <stdio.h> /* Header file */
main()
{ /* Program execution starts here */ printf("Hello world"); /* Built-in function - printf() */ return 0; }
1.Comments should be enclosed within /* */ and they won’t get executed.
2.Program execution always start from the main function. 3.printf() is a library function available in “stdio.h” header file.
It is used to format and print data. 4.Header file contains the built-in functions and pre-defined variables.
ALSo
hello.c is the file containing the above program. Below command is used to compile the c program.
gcc <C File Name>
i.e. gcc hello.c
{ /* Program execution starts here */ printf("Hello world"); /* Built-in function - printf() */ return 0; }
1.Comments should be enclosed within /* */ and they won’t get executed.
2.Program execution always start from the main function. 3.printf() is a library function available in “stdio.h” header file.
It is used to format and print data. 4.Header file contains the built-in functions and pre-defined variables.
ALSo
hello.c is the file containing the above program. Below command is used to compile the c program.
gcc <C File Name>
i.e. gcc hello.c
Comments
Post a Comment