Using nested if and extended if | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Using nested if and extended if

Write a program that takes three integers from the user (x, y, z) compares them and finds the maximum of them the second largest and the smallest

10th May 2018, 8:52 AM
Fenny Otieno
Fenny Otieno - avatar
2 Answers
0
if (x>y){ if (x>z){ cout <<x; } else{ cout <<z; } } else if (y>z){ cout <<y; } else { cout <<z; }
10th May 2018, 9:07 AM
Yugabdh
Yugabdh - avatar
0
Thanks
10th May 2018, 9:18 AM
Fenny Otieno
Fenny Otieno - avatar