- Home
- Course Category
- Course Result
- Course Detail
Hot Line: 0124-2383121
Course Introduction
Programs for practice
Following C++ program ask to user to enter the two number and perform addition, subtraction, multiplication and division on the two entered number:
Source Code: Add, Subtract, Multiply, Divide numbers
/* C++ Program - Addition, Subtraction, Multiplication, Division */
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int a, b, res;
cout<<"Enter two numbers :";
cin>>a>>b;
res=a+b;
cout<<"\nSum = "<<res;
res=a-b;
cout<<"\nDifference = "<<res;
res=a*b;
cout<<"\nProduct = "<<res;
res=a/b;
cout<<"\nQuotient after Division = "<<res;
getch();
}
Output
Enter two numbers : 6 3
Sum = 9
Difference = 3
Product = 18
Quotient after Division = 2