Advertisement
Kagalive

Simple Int operations

Sep 30th, 2020
1,400
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.39 KB | None | 0 0
  1. #include <iostream> //For std::cin, std::cout
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6.  cout << " a = ? ";
  7.  int a{};
  8.  cin >> a;
  9.  
  10.  cout << " b = ? ";
  11.  int b{};
  12.  cin >> b;
  13.  
  14.  cout << '\n';
  15.  cout << " a + b = " << (a+b) << '\n';
  16.  cout << " a - b = " << (a-b) << '\n';
  17.  cout << " a * b = " << (a*b) << '\n';
  18.  cout << " a / b = " << (a/b) << '\n';
  19.  cout << " a % b = " << (a%b) << '\n';
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement