fork(1) download
  1. //Nicolas Ruano CS1A Chapter 4, Pp. 220, #
  2. //
  3. /******************************************************************************
  4.  * CALCULATING THE MAXIMUM AND THE MINIMUM
  5.  * ____________________________________________________________________________
  6.  * This program will ask the user regarding about inputing two numbers to tell
  7.  * which one of the numbers is more or less
  8.  * ____________________________________________________________________________
  9.  * INPUT
  10.  * num1 : The first number inputed by the user
  11.  * num2 : the second number inputed by the user
  12.  *
  13.  * OUTPUT
  14.  * The number that has the more or lease value compared to the other number
  15.  * itself
  16. ******************************************************************************/
  17. #include <iostream>
  18. #include <limits> // For input validation
  19. using namespace std;
  20.  
  21. int main() {
  22. // Establish Input Variables - Data Dictionary
  23. int numOne; // INPUT : The first number the user has input
  24. int numTwo; // INPUT : The second number the user has input
  25.  
  26. // Ask User for the first number
  27. cout << "What is the first number?" << endl;
  28. cin >> numOne;
  29.  
  30. // Ask User for the second number
  31. cout << "What is the second number?" << endl;
  32. cin >> numTwo;
  33.  
  34. // Determine which number has the least value
  35. if (numOne < numTwo)
  36. {
  37. cout << numOne << " is less than " << numTwo << endl;
  38. }
  39. else
  40. {
  41. cout << numTwo << " is less than " << numOne << endl;
  42. }
  43.  
  44.  
  45. return 0;
  46. }
  47.  
Success #stdin #stdout 0s 5320KB
stdin
Standard input is empty
stdout
What is the first number?
What is the second number?
-580519648 is less than 32764