Program for constructor and distructor of the class date ♥
#include<iostream.h>
#include<conio.h>
class date
{
private:
int dd;
int mm;
int yy;
public:
date(int d,int m,int y)
{
dd=d;
mm=m;
yy=y;
}
void display()
{
cout<<"\n\t"<<dd<<"-"<<mm<<"-"<<yy;
}
};
void main()
{
clrscr();
date d1(05,01,91);
d1.display();
getch();
}
Here Is the Output :)
No comments:
Post a Comment