Hello World Program in C

Hello World Program in C Language With Code

Before starting  C language, you must first learn how to write, compile and run C programs. Beginning to learn any programming  language start with “Hello World Program“. Write a Hello World Program in C  after that execute the program and program will prints ‘Hello World’. In this program we will use following syntex:

#include<stdio.h>
#include<conio.h>
void main()
{
clrscr();

printf("\n Hello World! ");

getch();

}

Output

  1. #include and #include both these statements are called header files, it is a preprocessor directive that is already there in the compiler. Basically the job of these header files is to do the content. we use these two statements to include some file or code in our program.
  2. int main or void main():C compiler starts reading the program from int main () or void main(). In this program, whatever statement we have to execute or compile, we will wrap them inside { } curly brackets.
  3. clrscr():This would have been a function whose job is to clear the output screen of the first program. This function is included in the header file.
  4. getch():This function is used to hold the output screen.After the output screen of the program is shown, we have to press the key from the keyboard, then we come to the return source code screen. It is included in the conio.h header file.
TOP