Bhaktaraz

Web Enthusiastic, Nature Lover

A very first program in c++ with the concept of class

include<iostream.h>
using namespace std;

class person
{
private:
char name[20];
int age;

public:
void getdata(void);
void dislpay(void);
};
void person :: getdata(void)
{
cout<<"Enter name:";
cin>>name;
cout<<"Enter age:";
cin>>age;
}
void person :: display(void)
{
cout<<"\nName: "<
cout<<"\nAge: "<
}
int main()
{
person p;

p.getdata();
p.display();

return 0;
}

2 Comments on “A very first program in c++ with the concept of class”

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.