c++ program for give value using parametrised constructer - c program with parth patthar

c program with parth patthar

learn c and c++ in better way and with simple example.

Believe on your own logic

Saturday, November 24, 2018

c++ program for give value using parametrised constructer


/*give value using parametrised constructer */
#include<iostream.h>
#include<conio.h>
class parth
{
int a,b;
public:
parth(){}
parth(int x)
{
a=x/10;
b=x%10;
}
void put()
{
cout<<"\n"<<a;
cout<<"\n"<<b;

}
};
int main()
{
clrscr();
int a=60;
parth p1;
p1=a;
p1.put();
getch();
return(0);
}

No comments:

Post a Comment