#include<iostream.h>
#include<conio.h>
class test
{
private: //static Data Member
static int a;
static int a;
static float pi; // Static Data Member
public:
void static display() // Static Member
Function
Function
{
cout<<"\n Main Class Value is="<<pi*a*a;
}
} ;
float test :: pi = 3.14; // Static Data Member Initialization
int test :: a = 5; //Static Data Member Initialization
main()
{
clrscr();
test t1;
t1.display();
getch();
}
No comments:
Post a Comment