A Calculator

Here it is:
 ``1234567891011121314151617181920212223242526272829303132333435363738394041`` ``````#include #include int main() { using namespace std; int a; int b; int c; char addition; char subtraction; char multiplication; char division; int answer; cout <<" Calculator !!! " << endl; cout <<" Made by UdAy ShArMa the GREAT!!! " << endl; cout <<" PLease ENTER a number. " << endl; cin >> a; cout << " PLease ENTER the operation: (1) addition,(2) subtraction,(3) multiplication,(4) division. " << endl; cin >> b; cout << " PLease ENTER another number. " << endl; cin >> c; if (b == 1){ answer = a + c; } if (b == 2){ answer = a - c; } if (b == 3){ answer = a * c; } if (b == 4){ answer = a / c; } cout << " Your anSwer is "<< answer <<", OMG that's sooo cool. "<< endl; return 0; } ``````
??????????????????????????????????
Damn encoding, I can't see any character Shinigami.
it works
Instead of what you have, it should look more like this*:
 ``123456789101112131415161718192021222324252627282930313233343536373839`` ``````#include // Notice how I got rid of cmath. You didn't use it at all in your program. int main() { using namespace std; int a; int b; int c; char addition; char subtraction; char multiplication; char division; int answer; cout <<" Calculator !!! " << endl; cout <<" Made by UdAy ShArMa the GREAT!!! " << endl; cout <<" PLease ENTER a number. " << endl; cin >> a; cout << " PLease ENTER the operation: (1) addition,(2) subtraction,(3) multiplication,(4) division. " << endl; cin >> b; cout << " PLease ENTER another number. " << endl; cin >> c; if (b == 1){ answer = a + c; } else if (b == 2) { answer = a - c; } else if (b == 3) { answer = a * c; } else { answer = a / c; } cout << " Your anSwer is "<< answer <<", OMG that's sooo cool. "<< endl; return 0; }``````

I'm not going into how you could use an array to let them input as many numbers and operations as they like.

Oh wait, were you just showing off the code? Or asking for help?

*Note that I'm not referring to your formatting.
yo don't im just 12
Don't what? Age is irrelevant.
Topic archived. No new replies allowed.