[6502acme] Nihad
Viewer
- #include <iostream>
- int main() {
- double num1, num2;
- char operation;
- double result;
- std::cout `oaicite:{"index":0,"invalid_reason":"Malformed citation << \"Enter the first number: \";\n std::cin >>"}` num1;
- std::cout `oaicite:{"index":1,"invalid_reason":"Malformed citation << \"Enter the second number: \";\n std::cin >>"}` num2;
- std::cout `oaicite:{"index":2,"invalid_reason":"Malformed citation << \"Enter the operation (+, -, *, /): \";\n std::cin >>"}` operation;
- switch (operation) {
- case '+':
- result = num1 + num2;
- break;
- case '-':
- result = num1 - num2;
- break;
- case '*':
- result = num1 * num2;
- break;
- case '/':
- result = num1 / num2;
- break;
- default:
- std::cout << "Invalid operation";
- return 0;
- }
- std::cout << "Result: " << result << std::endl;
- return 0;
- }
Editor
You can edit this paste and save as new: