my friend wrote a c++ code, it's not working, and he came to me for help. the problem is that i don't know c++ :) i'm more interested in python and i don't want to learn c++ anytime soon, so i come here for help :) here's the code
#include<iostream>
using namespace std;
int main (){
char a ;
cin >> a ;
switch (a) {
case '+' :
int x , y , result ;
cout << "Enter A number >> " ;
cin >> x ;
cout << endl ;
cout << "Enter A number >> " ;
cin >> y ;
cout << endl ;
result = x+y ;
cout << "The Answer Is >> " << result << endl ;
break ;
case '-' :
int x , y , result ;
cout << "Enter A number >> " ;
cin >> x ;
cout << endl ;
cout << "Enter A number >> " ;
cin >> y ;
cout << endl ;
result= x-y ;
cout << "The Answer Is >> " << result << endl ;
break ;
default :
cout << "Please choose the right operaions !" << endl ;
}
return 0 ;
}