hi
i need to make a program that uses a "while loop" to find the smallest of user defined integers
can anyone give me a hint?
Printable View
hi
i need to make a program that uses a "while loop" to find the smallest of user defined integers
can anyone give me a hint?
What you mean by "smallest of user defined integers"? As in you have say, an array of integers from user input, and you want to find the minimum element in this array?
declare a variable min and initialize with first int
compare min with every int. if an int is less than min, then assign min to that int
when you have finished all the int, min should be the minimum
the values can be stored in an array and use a while loop with an index
thank u:)