Advertisement
esraa_syam

Untitled

Oct 25th, 2022
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. void esraa()
  4. {
  5. ios_base::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
  6. #ifndef ONLINE_JUDGE
  7. freopen("input.txt", "r", stdin), freopen("output.txt", "w", stdout);
  8. #endif
  9. }
  10. int main(){
  11. //esraa();
  12. cout << "Enter two numbers " ;
  13. double a , b ;
  14. cin >> a >> b;
  15. cout << "Enter operation";
  16. char operation;
  17. cin >> operation;
  18. //cin >> a >> b >> operation;
  19. if(operation == '+') cout << "a + b = "<< a + b << '\n';
  20. else if(operation == '-') cout << "a - b = " << a - b << '\n';
  21. else if(operation == '/') cout << "a / b = " << a / b << '\n';
  22. else if(operation == '*') cout << "a * b = " << a * b << '\n';
  23. return 0;
  24. }
  25.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement