I want to write C++ first program

Asked By 60 points N/A Posted on -
qa-featured

I want to write C++ first program please any one give me its concept.

SHARE
Best Answer by saifullah407
Answered By 5 points N/A #96372

I want to write C++ first program

qa-featured

Hi dear,

I provide you simple code example please check it.

# include <iostream.h>
 
main()
{
cout << "Welcome to Virtual University of Pakistan";
}

You run this program in Dev C++

OK.

Best Answer
Best Answer
Answered By 0 points N/A #96373

I want to write C++ first program

qa-featured

Hi dear,

First you install Dev c++ any version in your system. Then open dev click on file, new and select source file or use (short key ctrl +N). You can see below on pitcher.

Then you write this program:

1. #include<iostream>

2. #include<conio.h>

3. Using namespace std;

4. Int main( )

5. {

6. Cout<<"Welcome to your first program of c++"<<endl;

7. Getch ( );

8. Return 0;

9. }

 Now click on file and save this program by any name. Then click on Executes and select Compile&Run.

Concept: The first 2 lines of this program #include<iostream> and #include<conio.h> are called header files which are use for include some library files. 3rd line use for compiler. 4th and 8 lines must use in your every program because without these line your program not successfully compile.

Your all code must be in brackets. 7th line use for view your output (stop console window). 6th line use for your print line if you write in cout<<"hello"; so your output will be hello and if you write in cout<< "welcome"; your output will be welcome. And last endl use for new line.

Your first program of c++ is complete.

Dev c++ 4.9.9.7-new-source file

Related Questions