Write a program to find maximum out of three number using inline functions. Also aim to
display number of object created.
Input
#include<iostream>
using namespace std;
inline int max(int a,int b,int c)
{
int max;
max=(a>b && a>c) ? (b>c) ? a:b:c;
return max;
}
int main()
{
int a,b,c;
cout<<"enter the three number"<<endl;
cout<<"a=";
cin>>a;
cout<<"b=";
cin>>b;
cout<<"c="; // calling the function
cin>>c;
int large=max(a,b,c);
cout<<"max number is: "<<large;
return 0;
}
Output