Tuesday 28 January 2020

cpp program to find out greatest integer using three integer

Source Code:

#include<iostream>
using namespace std;
int main()
{
int a,b,c;
cout<<"Enter three integers: ";
cin>>a>>b>>c;
if(a>b)
{
if(a>c)
{
cout<<"The greatest number is: "<<a;
}
else
{
cout<<"The greatest number is: "<<c;
}
}

else
{
if(b<c)
{
cout<<"The greatest number is: "<<c;
}
else
                  [
cout<<"The greatest number is: "<<b;
                  ]
}

   return 0;
}

Program Output:
 

No comments:

Post a Comment