#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();
}
#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();
}
![[del.icio.us]](http://www.itshala.com/wp-content/plugins/bookmarkify/delicious.png)
![[Digg]](http://www.itshala.com/wp-content/plugins/bookmarkify/digg.png)
![[dzone]](http://www.itshala.com/wp-content/plugins/bookmarkify/dzone.png)
![[Facebook]](http://www.itshala.com/wp-content/plugins/bookmarkify/facebook.png)
![[Google]](http://www.itshala.com/wp-content/plugins/bookmarkify/google.png)
![[LinkedIn]](http://www.itshala.com/wp-content/plugins/bookmarkify/linkedin.png)
![[Twitter]](http://www.itshala.com/wp-content/plugins/bookmarkify/twitter.png)
![[Windows Live]](http://www.itshala.com/wp-content/plugins/bookmarkify/windowslive.png)
![[Yahoo!]](http://www.itshala.com/wp-content/plugins/bookmarkify/yahoo.png)
![[Email]](http://www.itshala.com/wp-content/plugins/bookmarkify/email.png)
