Question #191861

Construct a C++ program to find the square of a number using default arguments and inline functions



Expert's answer

#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;
}

LATEST TUTORIALS
APPROVED BY CLIENTS