//Written by MA Saleh
#include <stdio.h>
int main()
{
int ara[10], i, j;
printf("Enter 10 different number's for finding max and min value:\n");
while(1==1)
{
for(i = 0; i < 10; i++)
{
scanf("%d", &ara[i]);
}
int max = ara[0];
int min = ara[0];
for(j = 0; j < 10; j++)
{
if(max < ara[j])
{
max = ara[j];
}
if(min > ara[j])
{
min = ara[j];
}
}
printf("The Max Value in this array is: %d \nThe min Value in this array is: %d\n\n\n", max, min );
printf("Again Enter 10 different number's for finding max and min value:\n");
}
return 0;
}
//Copyright@MAS
0 comments:
Post a Comment