source file name: inline2.cpp
#include<iostream.h>
#include<conio.h>
inline long sq(int m)
{
return m*m;
}
inline long cube( int n)
{
return n*n*n;
}
void main()
{
clrscr();
cout<<" Inline Functions program:"<<endl;
cout<<" \n Square  is : "<<sq(6);
cout<<" \n Cube is: "<<cube(5);
getch();
}
 

Output:

Inline Functions program:

Square is: 36

Cube is: 125