/* Minimum Maximum - This program asks the user to enter two numbers. It uses theconditional operator to determine which number is the smaller and which is thelarger. */#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;}
Thursday, November 17, 2016
Programming Challenge 4.1 - Minimum Maximum
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment