Tuesday, 3 July 2018

a c++ program that preform all the mathematical operation on two numbers

Write a program that preform all the mathematical  operation on two numbers that is taken from user

///////// solutions
   
#include <iostream>
using namespace std;

int main() {

 int n,m;
cout<<"Enter the First number"<<endl;
cin>>n;
cout<<"Enter the Second number"<<endl;
cin>>m;

 cout<<"The sum is "<<n+m<<endl;
 cout<<"The sum is "<<n-m<<endl;
 cout<<"The sum is "<<n*m<<endl;
 cout<<"The sum is "<<n/m<<endl;
 cout<<"The sum is "<<n%m<<endl;
 
}

No comments:

Post a Comment