Thursday, October 28, 2010

Student Detail Enter & Display

#include

#include

class student

{

char name[20];

int roll;

int age;

public:

void getdata();

void putdata();

};

void student::getdata()

{

cout<<"\n enter name:";

cin>>name;

cout<<"\n enter roll no:";

cin>>roll;

cout<<"\n enter age:";

cin>>age;

}

void student::putdata()

{

cout<<"\n name :"<

cout<<"\n roll :"<

cout<<"\n age :"<

}

const int size=25;

void main()

{

clrscr();

student s1[size];

for(int i=0;i

{

cout<<"\n enter details of student "<

s1[i].getdata();

}

for(i=0;i

{

cout<<"\n details of student "<

s1[i].putdata();

}

getch();

}

No comments:

Post a Comment