display menu choice using if else



Write a program that accept two integers and than show a choice to display the result according

#include<iostream.h>
int main()
{
int a,b,c;
cout<<"\n"<<" Enter First Number = ";
cin>>a;
cout<<"\n"<<" Enter Second Number = ";
cin>>b;
cout<<"\n\n";
cout<<"\n 1. Addition";
cout<<"\n 2. Subtraction";
cout<<"\n 3. Multiplication";
cout<<"\n 4. Division";
cout<<"\n\n Enter your choice = ";
cin>>c;
if(c==1)
cout<<"\n\n Sum = "<<a+b;
else if(c==2)
cout<<"\n\n Subtraction = "<<a-b;
else if(c==3)
cout<<"\n\n Multiplication = "<<a*b;
else if(c==4)
cout<<"\n\n Division = "<<a/b;
else
cout<<"\n\n Wrong Operator";
system("pause");
return 0;
}