Find minimum in array Data structure by R4R Team


collection of same data type.
-We have to find the minimum in integer array.

array is {1,2,3,6,0,34,21}
then minimum is 0


#include < stdio.h>
int main()
int a[20],i,min;
printf("Enter 10 number in array\n");
for(i=0;i< 10;i++)
for(i=1;i< 10;i++)
if(a[i]< min)
printf("Minimum number in array is %d",min);


Enter 10 number in array
1 2 3 4 5 6 7 8 9 0
Minimum number in array is 0

-In this program, we create a array with max size 20, but we take an input of 10 numbers in array.
-Then we take first number as a minimum and check other elements,if any other element is smallest then min then assign number to min and continue this process until loop finish.

Leave a Comment:
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!