#include<iostream.h>
#include<conio.h>
class mahi
{
int a;
public:
int b;
void getdata();
int get_a(void);
void show_a(void);
};
class pal:private mahi
{
int c;
public:
void mul(void);
void display(void);
};
void mahi::getdata(void)
{
cout<<"\n Enter The Value of A: ";
cin>>a;
cout<<"\n Enter The Value of B: ";
cin>>b;
}
int mahi::get_a()
{
return a;
}
void mahi::show_a()
{
cout<<"\n A= "<<a;
}
void pal::mul()
{
getdata();
c=b*get_a();
}
void pal::display()
{
show_a();
cout<<"\n b= "<<b;
cout<<"\n c= "<<c;
};
void main()
{
clrscr();
pal p;
p.mul();
p.display();
p.mul();
p.display();
getch();
}
#include<conio.h>
class mahi
{
int a;
public:
int b;
void getdata();
int get_a(void);
void show_a(void);
};
class pal:private mahi
{
int c;
public:
void mul(void);
void display(void);
};
void mahi::getdata(void)
{
cout<<"\n Enter The Value of A: ";
cin>>a;
cout<<"\n Enter The Value of B: ";
cin>>b;
}
int mahi::get_a()
{
return a;
}
void mahi::show_a()
{
cout<<"\n A= "<<a;
}
void pal::mul()
{
getdata();
c=b*get_a();
}
void pal::display()
{
show_a();
cout<<"\n b= "<<b;
cout<<"\n c= "<<c;
};
void main()
{
clrscr();
pal p;
p.mul();
p.display();
p.mul();
p.display();
getch();
}
No comments:
Post a Comment