0

Can you say where is a problem. It's a calculator

#include <iostream> using namespace std; float calc(int a, float c, float d){ switch(a) { case'+': cout << c+d; break; case'-': cout << c-d; break; case'*': cout << c*d; break; case'/': cout << c/d; break; } } void main() { cout << "Enter arithmetical action-,+,*,/"; float x,y; char o; cout << "Enter action"; cin << o: cin << x; cin << y; calc(o,x,y); }

5th Jan 2017, 8:51 PM
Владислав Кащук
Владислав Кащук - avatar
2 Respuestas
+ 7
put whitespace after case before quote.
5th Jan 2017, 8:54 PM
Valen.H. ~
Valen.H. ~ - avatar