what is inline function in c++ with example

what is inline function in c++ with example

What Is Inline Function In C++ With Example

what is inline function in c++ with example






What Is Inline Function In C++ With Example


#include<iostream.h>
#include<conio.h>
inline int add(int x, int y)
{
return(x+y);
}
inline int sub(int x,int y)
{
return(x-y);
}
void main()
{
int a,b;
clrscr();
cout<<"Enter the value of a and b is:"<<endl;
cin>>a>>b;
cout<<"The addition of two no is:"<<add(a,b)<<endl;
cout<<"The subtraction of two no is:"<<sub(a,b)<<endl;
getch();
}


Post a Comment

0 Comments