// using global variable
#include<iostream>
using namespace std;
int a=0,b=0,c=0,x,y,z,m;
void input_num()
{
cout<<"Enter Value of a ";
cin>>a;
cout<<"Enter Value of b ";
cin>>b;
cout<<"Enter Value of c ";
cin>>c;
}
int maximum(int a,int b,int c)
{
if(a>b)
if(a>c)
return a;
else
return c;
else
if(b>c)
return b;
else
return c;
}
int main()
{
input_num();
m=maximum(a,b,c);
cout<<m<<endl;
}
// using pass by reference
#include<iostream>
using namespace std;
int input_num(int &a,int &b,int &c)
{
// int a,b,c;
cout<<"Enter Value of a ";
cin>>a;
cout<<"Enter Value of b ";
cin>>b;
cout<<"Enter Value of c ";
cin>>c;
// return a,b,c;
}
int maximum(int a,int b,int c)
{
if(a>b)
if(a>c)
return a;
else
return c;
else
if(b>c)
return b;
else
return c;
}
int main()
{
int a=0,b=0,c=0,m;
input_num(a,b,c);
m=maximum(a,b,c);
cout<<m<<endl;
}