Largest number in Class.cpp

Kali26 · updated September 23, 2020 · C++
#include <iostream>
using namespace std;
inline int largest (int&a,int&b,int&c)
{
    int big=0;
    if(a>b)
    big=a;
    else
    big=b;
    if(c>big)
    big=c;
    return big;
}
int main()
{
int a,b,c;
cout<<"Enter the number"<<endl;
cout<<"\n a = ";
cin>>a;
cout<<"\n b = ";
cin>>b;
cout<<"\n c = ";
cin>>c;
int large=largest (a,b,c);
cout<<"\n Largest of "<< a <<", "<< b <<" and "<< c <<" is "<< large ;
return(0);
}

Comments

Please sign up or log in to contribute to the discussion.