fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main(void) {
  5. /* the two numbers */
  6. int number1,number2;
  7.  
  8. /* we will save the larger number here */
  9. int max;
  10.  
  11. /* read two numbers */
  12. cin >> number1;
  13. cin >> number2;
  14.  
  15. /* we temporarily assume that the former number is the larger one */
  16. /* we will check it soon */
  17. max = number1;
  18.  
  19. /* we check if the assumption was false */
  20. if(number2 > max)
  21. max = number2;
  22.  
  23. /* we print the result */
  24. cout << "The larger number is " << max << endl;
  25.  
  26. /* we finish the program successfully */
  27. return 0;
  28.  
  29. }
Success #stdin #stdout 0s 4456KB
stdin
9
1
stdout
The larger number is 9