Wednesday, 21 September 2016

To chek the greatest number



Greatest of 3 numbers

#include < iostream.h >

void main()
{
int a,b,c;

cout<<"enter any three numbers:\n";
cin>>a>>b>>c;
if(a>b&&a>c)
cout<<"greatest number is:"<<a;
else if(b>c)
cout<<"greatest number is:"<<b;
else
cout<<"greatest number is:"<<c;
}

No comments:

Post a Comment