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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!