#include <iostream>
using namespace std;
class square
{
int a, asqr ;
public:
void geta();
inline void squarea();
void print();
};
void square::geta()
{
cout << endl << "Enter a:" ;
cin >> a ;
}
void square::squarea()
{
asqr = a*a ;
}
void square::print()
{
cout << endl << "Entered number(a)=" << a << endl << "Square of a=" << asqr << endl ;
}
int main()
{
square s1;
s1.geta();
s1.squarea();
s1.print();
return 0;
}
C and C++ programs, games, softwares. Easy programming guide. Learn to code and enjoy coding in CoderNepal
Home » Square using Inline Function
Square using Inline Function
This is the solution for finding Square of a number using Inline Function
Subscribe to:
Comments (Atom)
No comments:
Post a Comment