DESCRIPTION-:INLINE function is one which increase the performance of function in very large programs.Actually it replaces the function definition with the function call and with this the program control does not transfer to the function definition at each time when the function call is execute thus increases the performance.
PROGRAM-:
#include<iostream.h>
#include<conio.h>
inline int max(int x,int y)
{
return(x>y?x:y);
}
void main()
{
clrscr();
int a,b,c;
cout<<"enter two numbers";
cin>>a>>b;
c=max(a,b);
cout<<"greatest of two number is"<<c;
getch();
}
PROGRAM-:
#include<iostream.h>
#include<conio.h>
inline int max(int x,int y)
{
return(x>y?x:y);
}
void main()
{
clrscr();
int a,b,c;
cout<<"enter two numbers";
cin>>a>>b;
c=max(a,b);
cout<<"greatest of two number is"<<c;
getch();
}
0 comments:
Post a Comment