Algorithm to find the smallest number in an array in C [closed]

Assign first element of array to smaller

smaller = array[0];

Start a loop with i = 1 and compare elements with smaller. If smaller is greater than any of array element then replace it with that elment otherwise left it as it.

Browse More Popular Posts

Leave a Comment