Hello World program in c

 

Hello World Program

In c language , for writting hello world program , we need to add header files like as -
  • #include<conio.h>
  • #include<stdio.h>
After using header file we need to define main function like that-
  • void main()
  • int main()
  • int main(void)
Gernally we use void main() or int main() function, after this we use a predefine function clrscr.
  • clrscr(); - clrscr is a pre-define function for complier screen clear .
Now, we need to print massage , for this we will use a pre-define function that is printf 
  • printf(); - printf is a pre-define function that is use for any massage print for show , user.
after this we need one more pre define function that is getch .
  • getch(); - it is also a pre define function , it use for compiler window screen hold .
  Now , We will write program --------

  1. #include<conio.h>
  2. #include<stdio.h>
  3. void main()
  4.      clrscr();
  5.      printf("Hello World");
  6.      getch();
  7. }
   Program Pic..


Output pic..



Comments