Thursday, 17 January 2013

Load and view Name and Age with Class in C++

Write this program on Turbo C++ or Bordland C++ , and Save As Details.cpp


class persion{
char name[10];
int age;
  void getdata(){
  cout <<"Enter Name:";
  cout<<"Enter Age:";
  void display(){
  cout<<"Age of "<<name<<" is "<<age<<".\n";

void main(){
 persion a[20];
 int i,n;
 cout<<"Enter List Length( Up to 20 ) :";
 for(i=0; i<n; i++){
 for(i=0; i<n; i++){


 Enter List Length( Up to 20 ) :2
 Enter Name:Asif
 Enter Age:19
 Enter Name:Sujan
 Enter Age:18

 Age of Asif id 19.
 Age of Sujan is 18.

Thanks...Comment It...

No comments:

Post a Comment