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