Here is a C++ program to find square of number using inline function
SOURCE CODE OUTPUT
#include<iostream>
using namespace std;
inline int sqr(int x)
{
return x*x;
}
int main()
{
int x;
cout<<"Enter number : ";
cin>>x;
cout<<"Square of number : "<<sqr(x);
return 0;
}
using namespace std;
inline int sqr(int x)
{
return x*x;
}
int main()
{
int x;
cout<<"Enter number : ";
cin>>x;
cout<<"Square of number : "<<sqr(x);
return 0;
}
Any questions regarding to program please write in comments.
Can you give the brief explanation
ReplyDelete