#include<iostream>
#include<conio.h>
using namespace std;
int main()
{
int a,b,c,m;
cout<<"Enter any three number (a,b,c) : " ;
cin>>a>>b>>c;
if(a<b)
{
if(a<c)
{
if(b<c)
m=b;
else
m=c;
}
else
m=a;
}
else
{
if(b<c)
{
if(a<c)
m=a;
else
m=c;
}
else
m=b;
}
cout<<"Median = "<<m;
getch();
return(0);
}
No comments:
Post a Comment