Inline Function in C++ Programming
Inline function
#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();
}
0 coment�rios:
Post a Comment