[My site ]
Main » 2013 » December » 12 » Max and Min value
11:33 PM
Max and Min value
#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: 361 | Added by: ahansaary | Rating: 0.0/0
Total comments: 0
Only registered users can add comments.
[ Sign Up | Login ]