Construct a C++ program to find the square of a number using default arguments and inline functions
#include <iostream>
using namespace std;
inline int square(int s)
{
return s*s;
}
int main()
{
cout << "The square of 3 is: " <<
square(3) << "\n";
return 0;
}
Comments
Leave a comment