0

check code pls

#include<iostream> using namespace std; int main() { int a, b, c cout << "welcome to my calcuator app!"; /* welcome to my calcuator,please enter any three numbers , for addition put 1 as the second number , for multyplying put 2 as the second number , for substraction put 3 and for division put 4 */ cin a>>b>>c; if(b == 1) { cout<<"\n\n-excuting the operation...\n"; cout<<"\n The sum result is : "; cout<<a+b; if(b == 2) { cout<<"multiplying "<<a <<"in "<<c << "the result is:\n "<<a*b; if(b == 3) cout<<"substricting " <<a <<" from "<<b<<"please wait...\n"<<"-the result is: "<<a-b; if(b == 4) { cout<<"dividing "<<a<<" by "<<b<<" please wait...d\n"<<"-the result is: "<<a/b; } } cout << "\n\nThank you for using my calcuator!" return 0; } else { if(b > 4) cout << "you didn't enter a vaild number to excute the operation\noperarion can't be done\n thank you for using my app! "; return 0; } }

15th Jul 2020, 10:01 PM
UG.2
UG.2 - avatar
3 odpowiedzi
0
UG.2 here is the fixed calculator you missed a couple semicolons and the >> infront of cin >> btw you have a+b a*b a-b a/b b is the operator should be a+c a*c a-c a/c https://code.sololearn.com/c9NHHfvEj2N5/?ref=app
15th Jul 2020, 11:48 PM
BroFar
BroFar - avatar
0
UG.2 I sat for 12 minutes waiting for the page / code to display .... can you please clarify your question / and bring your code to the playground ? I saw it was suppose to be a cpp code ...
15th Jul 2020, 10:38 PM
BroFar
BroFar - avatar
0
BroFar it's ok i edited it
15th Jul 2020, 11:35 PM
UG.2
UG.2 - avatar