Program to Add of two numbers in C++.

Let’s write a program which print Sum of two numbers.

 

Step 1: Let’s open turbo C++ and write the following code.

 

// Code

 

//Add preprocessor

 

#include<iostream.h>

#include<conio.h>

void main()

{

long int   a,b,sum;

 

// clear screen

clrscr();

cout<<”enter first number:”;

cin>>a;

cout<<”enter Second number:”;

cin>>b;

sum=a+b;

cout<<”output is ”<<sum;

getch();

}

 

Step 2: Run the program and see Output.

 

Output:

 

output

 

Happy coding.

 

 

 

 

Tags: ,