Program to enter value and display back value by using concept of class and object.

#include
#include
class bca
{
private:
int x;
float y;
public:
void getdata();
void display();
};

void bca::getdata()
{
cout<>x;

cout<>y;
}
void bca::display()
{
cout<<"n Entered value of x was:"<<x;
cout<<"n Entered value of y was:"<<y;
}

Leave a reply