How would you find the smallest number from multiple integer inputs? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

How would you find the smallest number from multiple integer inputs?

8th Mar 2018, 5:11 PM
Whiless
Whiless - avatar
3 Answers
+ 10
U can take the inputs in an array & then use some sorting algorithm
8th Mar 2018, 5:23 PM
Gaurav Agrawal
Gaurav Agrawal - avatar
+ 3
i am not familiar with C++ so i will show only the pseudocode: minimum = first_input cycle{ val = next_input if (val < minimum){ minium = val } } print minimum
8th Mar 2018, 5:25 PM
Leshark
Leshark - avatar
+ 1
@Gaurav Agrawal that can be made simpler
8th Mar 2018, 5:25 PM
Leshark
Leshark - avatar