OneCompiler

im new to c++ and cant save my code can somwhone plzz help

i keep writing c++. python. css. etc. and cant save my code

3 Answers

7 months ago by

you just need to click 'Run' to run your code and it will auomatically save it. you also need to be logged in.

4 months ago by ReyMorado

#include<iostream>
using namespace std;
int main() {
float a, b; char op;
cout << "Enter a, b and operator: ";
cin >> a >> b >> op;

if(op == '+') cout << a + b;
else if(op == '-') cout << a - b;
else if(op == '*') cout << a * b;
else if(op == '/') cout << a / b;
else cout << "Invalid operator";

return 0;

}

1 month ago by akansha devi

#include<iostream>
using namespace std;
int main() {
float a, b; char op;
cout << "Enter a, b and operator: ";
cin >> a >> b >> op;

if(op == '+') cout << a + b;
else if(op == '-') cout << a - b;
else if(op == '*') cout << a * b;
else if(op == '/') cout << a / b;
else cout << "Invalid operator";

return 0;

}

1 month ago by akansha devi