/* Minimum Maximum - This program asks the user to enter two numbers. It uses the
conditional operator to determine which number is the smaller and which is the
larger. */
#include "Utility.h"
int main()
{
/* To hold two numbers, num1 and num2 */
int num1,
num2;
/* Ask the user for two numbers */
cout << "Enter a number: ";
cin >> num1;
cout << "Enter another number: ";
cin >> num2;
/* Determine which number is smaller which is greater */
(num1 < num2) ? cout << "number 1: " << num1 << " is smaller\n"
<< "number 2: " << num2 << " is greater\n" :
cout << "number 2: " << num2 << " is smaller\n"
<< "number 1: " << num1 << " is greater\n";
pauseSystem();
return 0;
}
No comments:
Post a Comment