0
[SOLVED] What is wrong
https://code.sololearn.com/c9VCf8GlemYh/?ref=app Iām trying to make a dumb calculator which sums, divides etc. with the user giving him a literal command (razlika means minus its Croatian) but I donāt know why it wonāt work. Please help I am new to this
2 Answers
+ 1
In line 13, remove the semicolon beside the parentheses and insert a closing curly bracket at line 16. In line 17, replace the semicolon with on opening curly bracket. That's all.
#include <iostream>
using namespace std;
int main() {
int x;
int y;
string z;
int sum;
int razlika;
cin >> x;
cin >> y;
cin >> z;
if (z== "zbroj"){
sum = x+y;
cout << sum;
}
else if (z=="razlika"){
razlika= x-y;
cout << razlika;
}
0
Thanks a bunch nik