fork download
  1. /*******************************************************************************
  2.  * Aiden Stannard // CS1A // Chapter 4 Homework: Challange 1#
  3.  *
  4.  * Calculate Min and Max
  5.  *
  6.  * This program receives two seperate numbers from the console and outputs
  7.  * which number is larger than the other.
  8.  *
  9.  * Inputs:
  10.  * Please Enter two whole numbers:
  11.  *
  12.  * Output:
  13.  * The ___ number you entered is greater than the ____
  14.  ******************************************************************************/
  15. #include <iostream>
  16. using namespace std;
  17.  
  18. int main()
  19. {
  20. int num1;
  21. int num2;
  22.  
  23. cout << "Please Enter two whole numbers:" << endl;
  24. cin >> num1;
  25. cin >> num2;
  26.  
  27. if (num1 > num2)
  28. cout << "The first number you entered is greater than the second number you entered" << endl;
  29. else
  30. cout << "The second number you entered is greater thaan the first" << endl;
  31. return 0;
  32. }
Success #stdin #stdout 0.01s 5320KB
stdin
3
9

stdout
Please Enter two whole numbers:
The second number you entered is greater thaan the first