c++ program for stat mathode - c program with parth patthar

c program with parth patthar

learn c and c++ in better way and with simple example.

Believe on your own logic

Saturday, November 24, 2018

c++ program for stat mathode

//code for stat methode in class
#include<iostream.h>
#include<conio.h>
class data
{
static int a;
int b;
public:
void get()
{
cout<<"enter a=";
cin>>a;
cout<<"enter b=";
cin>>b;
cout<<b;
}
static void display()
{
cout<<a;
}
};
int data::a;

int main()
{
clrscr();
data d;
d.get();
data::display();
getch();
return(0);
}

No comments:

Post a Comment