You are on page 1of 1

Write a program to use inline function for calculating the largest of

the two numbers.





#include<iostream.h>
#include<conio.h>
inline int large( int a, int b)
{
int max;
max=a;
if(b>max)
max=b;
cout<<"The largest of them is:"<<max;
return 0;

}

void main()
{
int x,y;
cout<<"Enter the value of x and y:";
cin>>x>>y;
large(x,y);
getch();
}



Output:

Enter the value of x and y: 4
6
The largest of them is: 6

You might also like