#include<iostream.h>
#include<conio.h>
class A
{ public:
int a;
int b;
int c;
A()
{
a=0;
b=0;
c=0;
}
A(int p,int q)
{
a=p;
b=q;
}
A(int f,int g,int h)
{
a=2*f;
b=2*g;
c=2*h;
}
void show()
{
cout<<"value of a\n"<<a;
cout<<"value of b \n"<<b;
cout<<"value of c \c"<<c;
}
};
void main()
{
clrscr();
int a,b,c;
cout<<"enter the value of a , b, c\n";
cin>>a>>b>>c;
A a1;
A a2(a,b);
A a3(a,b,c);
a1.show();
a2.show();
a3.show();
getch();
}
#include<conio.h>
class A
{ public:
int a;
int b;
int c;
A()
{
a=0;
b=0;
c=0;
}
A(int p,int q)
{
a=p;
b=q;
}
A(int f,int g,int h)
{
a=2*f;
b=2*g;
c=2*h;
}
void show()
{
cout<<"value of a\n"<<a;
cout<<"value of b \n"<<b;
cout<<"value of c \c"<<c;
}
};
void main()
{
clrscr();
int a,b,c;
cout<<"enter the value of a , b, c\n";
cin>>a>>b>>c;
A a1;
A a2(a,b);
A a3(a,b,c);
a1.show();
a2.show();
a3.show();
getch();
}
No comments:
Post a Comment