Professional Documents
Culture Documents
4 Unit 1 09 01 2024
4 Unit 1 09 01 2024
class classname {
public:
//Declaring the default constructor.
classname() {
}
};
class math
{ int main()
private:
int a,b,c; {
public:
math()
math o;
{ o.add();
a=0;
b=0; return 0;
}
void add()
}
{
c=a+b;
cout<<"Total : "<<c;
}
};
void show() {
cout << "Square of number =" << square << endl;
}
};
int main() {
Base b;
b.show();
return 0; }
Dr.J.saira banu , Associate Professor, SCOPE, VIT University
Parameterized constructor
class classname {
public:
//Declaring the default constructor.
classname( int, int ) {
}
};
Classname objname(list of parameters);