Returning smallest value | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
0

Returning smallest value

write a code that takes 3 non-equal integers and returns the smallest

21st Oct 2017, 5:30 PM
Argwings Kipchirchir
Argwings Kipchirchir - avatar
1 Réponse
+ 1
Going by short // Using ? and : int x, y, z; int smallest = (x < y && x < z) ?x: ((y < z) ?y: z); cout<<smallest; // Output will be the smallest num
31st Oct 2017, 2:57 PM
#RahulVerma
#RahulVerma - avatar