Write a c++ program to implement class of a person containing name and age
Answers
Answered by
1
class person
{ int age;
char name[100];
public:
void implem()
{cout<<"enter name";
cin>>name;
cout<<"enter age";
cin>>age;
}
void disp()
{
cout<<name;
cout<<age;
}
};
int main()
{
int x;
x.implem;
x.disp;
return 0;
}
hope it helps....
{ int age;
char name[100];
public:
void implem()
{cout<<"enter name";
cin>>name;
cout<<"enter age";
cin>>age;
}
void disp()
{
cout<<name;
cout<<age;
}
};
int main()
{
int x;
x.implem;
x.disp;
return 0;
}
hope it helps....
Similar questions
Environmental Sciences,
7 months ago
Math,
7 months ago