Write a CPP program to find greater between three numbers

 Code:-

#include<bits/stdc++.h>
using namespace std;
int main()
{
int a,b,c;
cout<<“Enter three numbersn”;
cin>>a>>b>>c;
if(a>b)
{
if(a>c)
cout<<a<<” is greater number”;
else
cout<<c<<” is greater number”;
}
else
{
if(b>c)
cout<<b<<” is greater number”;
else
cout<<c<<” is greater number”;
}
return 0;
}

Output:-

Enter three numbers
5 15 2
15 is greater number



Leave a Reply

Your email address will not be published.