#include<iostream.h>
#include<conio.h>
class student
{

static int cnt;
public:
void display()
{
cnt++;
cout<<"\n\nHello";
}
void show()
{
cout<<"\n\nDisplay function called "<<cnt<<" times";
}
};
int student::cnt;
int main()
{
student a,b,c;
clrscr();
a.display();
b.display();
b.show();
c.display();
c.show();
getch();
return 0;
}

Post a Comment

Previous Post Next Post