The first sample program in c++
Before starting the abcd of C++ language, you need to learn how to write, compile and run the first C++ program.
To write the first C++ program, open the C++ console and write the following code:
Paste your text here.#include <iostream.h>
#include<conio.h>
void main() {
clrscr();
cout << "Welcome to C++ Programming.";
getch();
}
How to compile and run the C++ program
There are 2 ways to compile and run the C++ program, by the menu and by shortcut.
By menu
Now click on the compile menu then compile submenu to compile the c++ program.
Then click on the run menu then run submenu to run the c++ program.
By shortcut
Or, press
ctrl+f9 keys compile and run the program directly.