0:13 AM 2007-2008 question 2 |
max and min value program
#include"stdio.h"
main()
{
int val, max, min, i;
printf("enter value 1 : ");
scanf("%d", &val);
max=val;
for(i=2;i<=5;i++){
printf("enter value %d : ", i);
scanf("%d", &val);
if(val>max){
max=val;
}
else if(val<min){
min=val;
}
}
printf("max value = %d ,, min value = %d", max, min);
getch();
}
|
|
Total comments: 0 | |