/*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