25th Jun 2017, 5:47 AM
Ash
Ash - avatar
5 Respuestas
+ 7
This works. #include <iostream> using namespace std; int main(){ double a,c,d; char b; cin>>a; cin>>b; cin>>c; if(b=='+'){ d=a+c; } if(b=='*'){ d=a*c; } if(b=='-'){ d=a-c; } if(b=='/'){ d=a/c; } cout<<d; return 0; }
25th Jun 2017, 5:55 AM
Krishna Teja Yeluripati
Krishna Teja Yeluripati - avatar
+ 11
You missed some semicolons and you used some special characters in place of comma and open parantheses at some places.
25th Jun 2017, 6:01 AM
Krishna Teja Yeluripati
Krishna Teja Yeluripati - avatar
+ 7
C++ always uses a semicolon behind.
25th Jun 2017, 6:42 AM
👑 Prometheus 🇸🇬
👑 Prometheus 🇸🇬 - avatar
+ 2
thanks. it does now. I don't know why it wasn't working 😱😱
25th Jun 2017, 5:59 AM
Ash
Ash - avatar
0
thanks
25th Jun 2017, 6:42 AM
Ash
Ash - avatar