/*
Constructor Demonstrate
*/
#include<iostream>
using namespace std;
class Sample
{
int a,b;
public:
Sample()
{
a=10;
b=20;
}
void display()
{
cout<<"\n\n A:"<<a;
cout<<"\n\n B:"<<b;
}
};
int main()
{
Sample s;
s.display();
return 0;
}
Constructor Demonstrate
*/
#include<iostream>
using namespace std;
class Sample
{
int a,b;
public:
Sample()
{
a=10;
b=20;
}
void display()
{
cout<<"\n\n A:"<<a;
cout<<"\n\n B:"<<b;
}
};
int main()
{
Sample s;
s.display();
return 0;
}