0
How do I solve this code error?
#include <iostream> using namespace std; int main() { double a,b,c; cout<< "Enter the values for a:"; cin >> a; cout << "Enter the values for b:"; cin>> b; int operation; cout << "Enter the operation [+,-,* or /]:)"; cin >> operation; switch(operation) { case '+': c = a+b; break; case '-': c = a-b; break; case '*': c = a*b; break; case '/': c = a/b; break; } cout<< a << operation << b << "=" << c; return 0; }
1 Antwort
+ 7
int operation; --> char operation;