Friday, 16 November 2012

Greater Number.


#include <iostream>
using namespace std;
int main()
{
int n1,n2,n3;
cout << "Enter 1st Number, 2nd Number and 3rd Number:\n";
cin >> n1 >> n2 >> n3;
if (n1 > n2 && n1 > n3)
cout << n1 << " is Greater." <<endl;
else if(n2 > n3 && n2 > n3)
cout << n2 << " is Greater." <<endl;
else if(n3 > n1 && n3 > n1)
cout << n3 <<" is Greater."<<endl;
else
cout << "Numbers are same."<<endl;
return 0;
}

No comments:

Post a Comment