Вы находитесь на странице: 1из 1

#include<stdio.

h>
#include<conio.h>
#include<iostream.h>
class first
{
protected:
int a;
void getdata()
{
cout<<"Enter Number:"<<endl;
cin>>a;
}
};
class second : public first
{
public:
int b;
void square()
{
getdata();
b=a*a;
cout<<"Square is :"<<b<<endl;
}
};
class third : public second
{
public:
int c;
void cube()
{
square();
c=b*a;
cout<<"Cube is :"<<c<<endl;
}
};
int main()
{
third th;
th.cube();
getch();
return 0;
}

Вам также может понравиться