#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 » T.U.2068 » C++ code for finding the Square of a Number using Inline Function
Monday, April 17, 2017
C++ code for finding the Square of a Number using Inline Function
This is the solution for finding Square of a number using Inline Function (T.U. 2067, 2068)
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment