#include <stdio.h>
int main(){
printf("\t\tMinimum & Maximum");
printf("\n============================================\n\n");
int a[10],i,min,max;
for(i=0;i<10;i++){
printf("Enter The Number [%d] : ",i+1);
scanf("%d",&a[i]);
if(i==0){
min=max=a[i];
}
else{
if(min>a[i]){
min=a[i];
}
else if(max<a[i]){
max=a[i];
}
}
}
printf("\n_______________________________________________\n\n");
printf("\nMinimum Value Is : %d\n",min);
printf("\nMaximum Value Is : %d",max);
printf("\n\n_______________________________________________\n\n");
return 0;
}
a
of size 10, and integer variables i
, min
, and max
.a
. During the loop, the program also updates the variables min
and max
to keep track of the minimum and maximum numbers seen so far.