C++ Programming Challenge 4-1: Minimum/Maximum (C++ Ternary Conditional Operator, C++ Conditional Statements)

Share it with your friends Like

Thanks! Share it with your friends!


Write a program that asks the user to enter two numbers.
The program should use a conditional operator to determine which number is the smaller
and which is the larger.

In this exercise we are using C++ If statements to compare two integers. We also discuss and use C++ Ternary conditional operator to get the same results as we did with the If statements.

Exercise from textbook: Starting Out With C++ From Control Structures Through Objects

Download Source Code: cplusplus-4-1-minimum-maximum


Write a comment