Advertisement
Kagalive

conditions-v1

Oct 1st, 2020
1,101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.28 KB | None | 0 0
  1. #include <iostream>
  2. using std::cin;
  3. using std::cout;
  4.  
  5. int main()
  6. {
  7.  int a{2};
  8.  int b{3};
  9.  
  10.  cout << a << " * " << b << " = ? ";
  11.  
  12.  int userAnswer{};
  13.  cin >> userAnswer;
  14.  
  15.  if (userAnswer == (a*b) )
  16.  {
  17.    cout << "Correct!\n";
  18.  }
  19.  else
  20.  {
  21.   cout << "Wrong!\n";
  22.  }
  23.  
  24.  
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement