//calculator
//switch case
#include<iostream.h
void main()
{
float a,b,c;
int choice;
cout<<"enter the first number=";
cina;
cout<<"enter the second number=";
cinb;
cout<<"enter the operation\n1=addition\n2=substraction\n3=multiplication\n4=division\n";
cinchoice;
switch(choice)
{
case 1:
c=a+b;
cout<<"addition="<<c;
break;

case 2:
c=a-b;
cout<<"substraction="<<c;
break;

case 3:
c=a*b;
cout<<"product="<<c;
break;

case 4:
c=a/b;
cout<<"quotient="<<c;
break;

default:
cout<<"wrong choice";

}
}

explaination:In this program the swi...

Continue reading ...