#include
#include
class person
{
char name[20];
int age;
public:
void getdata(void);
void display(void);
};
void person::getdata(void)
{
cout<<"Enter name: "; cin>>name;
cout<<"Enter age: "; cin>>age;
}
void person::display(void)
{
cout<<"\n Name: "<
int main()
{
clrscr();
person p;
p.getdata();
p.display();
getch();
return 0;
}
Output:
Enter name: vivasolve.blogspot.com
Enter age: 21
Name: vivasolve.blogspot.com
Age: 21
No comments:
Post a Comment