C++ Program

Before starting our programming, we need to understand basics of write, compile and run.

Here is the first Program of C++,

#include<iostream.h>
#include<conio.h>
Void main(){
	clrscr();
	cout<<”Hello World”;
	getch();
}


  • Line Starting with #include are header files. Used to include functions.
  • #include<iostream.php> includes input output standard library function. It contains the definition of cin and cout.
  • #include<conio.h> includes console input output library functions. getch() and clrscr() function is defined in conio.h
  • Void main() The main() function is the entry point of any program in C++. void is the keyword which means this function contain no return value.
  • clrscr() This function is used to clear the previous output on the console screen(clr+scr = Clear Screen)
  • cout<<”Hello World” : is used to print Hello world on console.
  • getch(): It requires a character when you are at console screen. It helps to hold the console screen. (get + ch = Get Character)
Back To Top