Default Constructor.Default constructor is Utse to Initialize the variable and How it's There Work in C++

#include<iostream.h>
#include<conio.h>

class second
{
  private:
     int a,b,c;
  public:
     second()//Default constructor Make.
     {
        a=1000;
        b=700;
        c=8000;
     }
     void display()
     {
        cout<<"\nThe Value of A=>"<<a<<endl;
        cout<<"\nThe Value of B=>"<<b<<endl;
        cout<<"\nThe Value of C=>"<<c<<endl;
        cout<<"\nThe Total Of All=>"<<a+b+c<<endl;
     }
};
void main()
{
  clrscr();
  second s1;//Default Constructor is Call.
  s1.display();
  getch();
}
Default Constructor.Default constructor is Utse to Initialize the variable and How it's There Work in C++ Default Constructor.Default constructor is   Utse to Initialize the variable and How it's There Work in C++ Reviewed by Unknown on 5:59:00 PM Rating: 5

No comments:

Powered by Blogger.