Write a program to perform various list operations after displaying menu.
Answers
Answer:
PROGRAM
This is a user-defined C++ program to carry out the operations. The program displays a menu, asking the user to enter the values and the type of operation he/she wants to perform on those values.
Program is as follows :-
#include<iostream.h>
#include<conio.h>
#include<process.h>
void main()
{
clrscr();
int x,y,a=0,s=0,d=0,m=0;
char ch;
A:
cout<<"Welcome to my calculation world \n";
cout<<"Enter any two integer values. \n";
cin>>x>>y;
cout<<"Now :- \n";
cout<<" 1. Press 'a' for addition. \n";
cout<<" 2. Press 's' for subtraction. \n";
cout<<" 3. Press 'd' for division. \n";
cout<<" 4. Press 'm' for multiplication. \n";
cin>>ch;
if(ch=='a')
{
a = x+y;
cout<<"The sum is "<<a<<endl;
}
else if(ch=='s')
{
s = x-y;
cout<<"The difference is "<<s<<endl;
}
else if(ch=='d')
{
d = x/y;
cout<<"The quotient is "<<d<<endl;
}
else if(ch=='m')
{
m = x*y;
cout<<"The product is "<<m<<endl;
}
cout<<"Want to calculate again ? \n";
cin>>ch;
if(ch=='y')
{
goto A;
}
else if(ch=='n')
{
exit(0);
}
getch();
}
Explanation:
This will help you please mark as brainiest
Answer:
I am big from her.. 1 year...