Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- solve the bug in the following code
- */
- #include <bits/stdc++.h>
- using namespace std;
- /*
- this program check if res = num1+num2
- or res = num1 - num2
- and print the right operator
- 1<= num1,num2 <=9
- -8<=res<=18
- */
- int main()
- {
- /*
- i was trying to write conditional opertator to make my code looks cool
- but something is wrong could you find it
- */
- int num1, num2, res;
- cin >> num1 >> num2 >> res;
- cout << (num1 + num2 == res) : "+" : "-";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement