Array:
collection of same data type.
-We have to find the minimum in integer array.
Example-array is {1,2,3,6,0,34,21}
then minimum is 0
program-
#include < stdio.h>
int main()
{
int a[20],i,min;
printf("Enter 10 number in array\n");
for(i=0;i< 10;i++)
scanf("%d",&a[i]);
min=a[0];
for(i=1;i< 10;i++)
{
min=a[i];
}
printf("Minimum number in array is %d",min);
}
output-
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.