[My site ]
Main » 2013 » December » 13 » 2007-2008 question 2
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();
}
Category: C Programming - 1 | Views: 398 | Added by: ahansaary | Rating: 0.0/0
Total comments: 0
Only registered users can add comments.
[ Sign Up | Login ]