I need an explanation and some step by step walk threw assistance figuring this one out. Thx guys
Lvl 4 lesson 5 (second smallest int)
Comments (1)
- Popular
- New
- Old
You must be signed in to leave a comment
Niilokas
29 August 2022, 06:39
Can't really remember, but I think one way would be first to have two integers smallest and secondSmallest that both have maximum values. If you loop through the numbers, if the number is smaller than both of those numbers then first assign smallest number to secondSmallest number and then user input to the smallest number. If the user input is bigger than smallest, but smaller than secondSmallest, then assign user input to secondSmallest.
After the loop return secondSmallest.
0