Question: This is in C programming language Consider the following code fragment: int x = ...some legal value here...; int y = ...some legal value here...;
This is in C programming language Consider the following code fragment:
int x = ...some legal value here...;
int y = ...some legal value here...;
int z = ...some legal value here...;
int minOfThree;
if ( x < y )
if ( x < z ) minOfThree = x;
else minOfThree = z;
else
if ( y < z )
minOfThree = y;
else minOfThree = z;
Re-write this code as a single statement without using the if, if-else, or switch constructs. You should use the conditional operator for this computation.
int minOfThree = .....what code goes here? ....
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
