Console Application Visual C++ 2008

5
1 How to Write Program in Visual C++ By Ariel T. Sumagaysay, MSCS 1. Load Visual Studio 2008 2. Click – File – New Project

Transcript of Console Application Visual C++ 2008

Page 1: Console Application Visual C++ 2008

1

How to Write Program in Visual C++ By Ariel T. Sumagaysay, MSCS

1. Load Visual Studio 2008

2. Click – File – New Project

Page 2: Console Application Visual C++ 2008

2

3. Select C++ - Win32 Console Application. Enter project name, and click OK button.

4. Click NEXT button

Page 3: Console Application Visual C++ 2008

3

5. Click empty project option, then click FINISH button

6. Select Source Files folder found at the Solution Explorer of Visual Studio 2008 found at the right side of the IDE.

Page 4: Console Application Visual C++ 2008

4

7. Right – Click Source file folder, select ADD – New Item.

8. Select C++ File (.cpp), enter Name and click ADD button.

Page 5: Console Application Visual C++ 2008

5

9. Enter the following codes: #include “stdio.h” #include “conio.h”

#include <iostream> using namespace std;

int main() { int A,B,C; cout << "Using the CIN keyword\n\n"; cout << "Enter A Value: "; cin >> A; cout << "\n"; cout << "Enter B Value: "; cin >> B; cout << "\n"; C = A + B; cout << "The result of Adding A & B: " << C << endl; _getch(); return 0; }

10. Press F5 to build and run your program. (or click Build – Rebuild,or click Build – Clean, or click – Compile – F5).