#include <iostream.h>
#include <conio.h>

class temp
{
     int a;
     public:
     static int c;

     void get(int t)
     {
          a=t;
          c++;
     }
     void display()
     {
          cout << a;
     }
     static void show()
     {
          cout << c;
     }
};
int temp :: c;

void main()
{
     temp t1,t2,t3;
     clrscr();
     t1.get(20);
     cout << "\n";
     t1.display();
     cout << "\n";
     temp :: show();
     t2.get(12);
     cout << "\n";
     t2.display();
     cout << "\n";
     temp :: show();
     temp :: c=30;
     cout << "\n";
     temp :: show();
     getch();
}

No tags Hide

Managed by

MNP INFOTECH