programming in C++ of Calculator
Answers
Answered by
3
A simple calculator can be made using a C++ program which is able to add, subtract, multiply and divide, two operands entered by the user. The switch and break statement is used to create a calculator.
Hope it's help you
Make me on Brainlist....
Answered by
0
Answer:
Try this code
Explanation:
#include <iostream>
using namespace std;
int main() {
float x,y;
char o;
cout<<"enter the first number\n";
cin>>x;
cout<<"enter the operation sympol\n";
cin>>o;
cout<<"enter the second number\n";
cin>>y;
switch(o){
case '+': cout<<x+y; break;
case '-' : cout<<x-y; break;
case '*' : cout<< x*y; break;
case '/' : cout<<x/y; break;
}
return 0;
}
Similar questions