LARGEST NUM

Muthumari_B · updated September 08, 2021 · C++
// Find largest number among three numbers using inline function


#include <iostream>
using namespace std;
inline int large(int a, int b, int c)
{
    if(a > b && a > c)
    return (a);
    else if (b > c)
    return (b);
    else
    return (c);
    
}
int main()
{
    int x, y, z;
    cout <<"Enter three values :";
    cin >>x >>y >>z;
    cout <<"\n" <<x <<"\n" <<y <<"\n" <<z<<endl;
    cout <<"\n";
    cout <<large(x, y, z) <<" is largest number"<<endl;
    return 0;
}

Comments

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