A program to demonstrate the concept of inline function in C++

#include<iostream>
#include<conio.h>
using namespace std;
inline void rect(int, int);
int main()
{
int l,b;
cout<<“enter length and breadth:”;
cin>>l>>b;
rect(l,b);
getch();
}
inline void rect(int l, int b)
{
int area;
area=l*b;
cout<<“Area=”<<area;
}

Output:

Leave a Reply

Your email address will not be published. Required fields are marked *