#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 » Cube using Inline Function
Cube using Inline Function
This is the solution for finding Cube of a given number using Inline Function in C++
Subscribe to:
Comments (Atom)
No comments:
Post a Comment