how to make a calculator in c++
Answers
Answered by
1
#include<iostream.h>
void main()
{
float a,b,ch;
cout<<"enter 2 nos.";
cin>>a>>b;
cout<<"1. for addition";
cout<<"2 for subtraction";
cout<<"3 for multiplication";
cout<<"4 for division";
switch(ch)
{
case 1: cout<<a+b;
case 2: cout<<a-b;
case 3: cout<<a*b;
case 4: cout<<a/b;
default:cout<<"no such option";
}
}
void main()
{
float a,b,ch;
cout<<"enter 2 nos.";
cin>>a>>b;
cout<<"1. for addition";
cout<<"2 for subtraction";
cout<<"3 for multiplication";
cout<<"4 for division";
switch(ch)
{
case 1: cout<<a+b;
case 2: cout<<a-b;
case 3: cout<<a*b;
case 4: cout<<a/b;
default:cout<<"no such option";
}
}
sri156:
r u a teacher ?
Answered by
0
hey mate here's your answer my sister
Attachments:
Similar questions