Write a code for :
a) Input two numbers and design a program which can perform the following functions
I. Add the number.
II. Subtract the numbers.
III. Find the remainder when one number is divided by the other.
IV. Find the quotient when normal division is performed.
V. Find the quotient when normal division is performed.
VI. Multiply the numbers
Answers
Answered by
10
Answer:
void main()
{
int choice=0;
int x,y;
cout<<"1-Add \n2-Subtract\n3-Find the remainder\m4-Find Quotient";
cout<<"\nEnter your choice";
cin>>choice;
switch(choice){
case 1:
cout<<"Enter the value 1 and value 2";
cin>>x>>y;
cout<<"\nAdd="<<x+y;
break;
case 2:
cout<<"Enter the value 1 and value 2";
cin>>x>>y;
cout<<"\nSub="<<x-y;
break;
case 3:
cout<<"Enter the value 1 and value 2";
cin>>x>>y;
cout<<"\nRemainder="<<x%y;
break;
case 4:
cout<<"Enter the value 1 and value 2";
cin>>x>>y;
cout<<"\nDivision="<<x/y;
break;
}
}
Explanation:
Similar questions