How to find the least value entered in array? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

How to find the least value entered in array?

So in a code project in sololearn I need to find the least valued no. entered by user in array? In c++.... How to do it? Can anyone explain..?

10th Dec 2021, 4:44 PM
Ashish Sharma
Ashish Sharma - avatar
1 Answer
+ 4
You can use sort method inbuild in c++. Another way with hard coding to learn more will be searching a minimum value. You can say my first item is the minimum and the check each item of your array if it is smaller than the minimum. If yes you replace this with the found item. At the end you got it.
10th Dec 2021, 5:24 PM
JaScript
JaScript - avatar