#include <iostream> using namespace std; class cube { int a, acube; public: void geta(); inline void cubea(); void show(); }; void cube::geta() { cout << endl << "Enter a number:" ; cin >> a ; } void cube::cubea() { acube = a*a*a ; } void cube::show() { cout << endl << "Entered number(a)=" << a << endl << "Cube of a=" << acube << endl ; } int main() { cube c1; c1.geta(); c1.cubea(); c1.show(); return 0; }
C and C++ programs, games, softwares. Easy programming guide. Learn to code and enjoy coding in CoderNepal
Home » T.U.2066 » C++ code for finding the Cube of a Number using Inline Function
Monday, April 17, 2017
C++ code for finding the Cube of a Number using Inline Function
This is the solution for finding Cube of a given number using Inline Function in C++ (T.U. 2066)
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment