Addition of Two Numbers in C++

In this programing tutorial you will learn how to add two numbers in C++ in easy way. We are performing simple arithmetic operation on two numbers or addition of two numbers and then we will show the sum of two number on the output screen. In this program we are taking the input from user.

Let’s suppose a user will input two numbers as '26' and '12' then as a result 38 will be printed on the output screen.

How this program will work?

C++ Addition Program


	#include<iostream.h>
	#include<conio.h>

	void main()
	{
		clrscr();
		int a,b,c;
		cout<<"ENTER THE FIRST NUMBER:- ";
		cin>>a;
		cout<<"\nENTER THE SECOND NUMBER:- ";
		cin>>b;
		c = a + b;
		cout<<"RESULT:- "<<c;
		getch();
	}

Output:


	ENTER THE FIRST NUMBER:- 26
	ENTER THE SECOND NUMBER:- 12
	RESULT OF TWO NUMBERS IS:- 38

Post Your Comment