Monday, November 17, 2014

Find Mean,Median and Median

 

Mean,Median and Median

 

 

#include<stdio.h>
#include<math.h>
 
int main ()
 
{
 
    int a,b,c;
 
    printf("Enter 3 numbers: ");
    scanf("%d%d%d",&a,&b,&c);
    printf("\n\n");
 
    if (a>b&&b>c)
        printf("Maximum= %d \nMedian= %d \nMinimum= %d",a,b,c);
    else if (c>a&&a>b)
        printf("Maximum= %d \nMedian= %d \nMinimum= %d",c,a,b);
    else if (b>c&&c>a)
        printf("Maximum= %d \nMedian= %d \nMinimum= %d",b,c,a);
    else if (a>c&&c>b)
        printf("Maximum= %d \nMedian= %d \nMinimum= %d",a,c,b);
    else if (b>a&&a>c)
        printf("Maximum= %d \nMedian= %d \nMinimum= %d",b,a,c);
    else if (c>b&&b>a)
        printf("Maximum= %d \nMedian= %d \nMinimum= %d",c,b,a);
 
    printf("\n\n\n");
    return 0;
 
}

No comments:

Post a Comment