Construct a C++ program to find the square of a number using default arguments and inline functions
#include <iostream>
using namespace std;
inline float square(float x = 0){
return x * x;
}
int main(){
cout<<square()<<endl;
cout<<square(3);
return 0;
}
Comments
Leave a comment