Min,Max,Mid by using C

#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,c,min,max,mid;
clrscr();
printf(” min and max value of a,b,c”);
scanf(“%d%d%d”,&a,&b,&c);
if(a<=b&&a<=c)
min=a;
else
if(b<=c)
min=b;
else
min=c;
if(a>=b&&a>=c)
max=a;
else
if(b>=c)
max=b;
else
max=c;
mid=a+b+c-max-min;
printf(“min=%d,max=%d.mid=%d”,min,max,mid);
getch();
}

After running program- we get this output 🙂

Leave a Reply