#include<stdio.h>
main()
{
int a[5] = {55,99,33,22,10};
int max,min,i;
max = a[0];
min = a[0];
for(i=0;i<=4;i++)
{
if(a[i]>max)
{
max = a[i];
}
if(a[i]<min)
{
min = a[i];
}
}
printf("the max element z %d\n",max);
printf("the min element z %d\n",min);
}
op :
the max element z 99
the min element z 10
0 comments: