#include <iostream.h>
#include<conio.h>
class Base
{
private:
double b;
public:
Base(double x)
{
b=x;
}
{
cout<<"\n Base Class Value Is"<<b;
}
double getValue()
{
return b;
}
};
class derive
{
private:
double d;
public:
derive(Base y)
{
d=y.getValue() * 1.6987;
}
void display()
{
cout << "\n derive Value Is"<<d;
}
};
main()
{
clrscr();
m1.display();
k1.display();
cout << endl;
getch();
}
No comments:
Post a Comment