You are on page 1of 2

#include<iostream>

using namespace std;

class stuInfo{

private:

int sid, age, dob;

char name[20], branch[20], year[8];

public:

void input(){

cout<<"Enter name:";

cin>>name;

cout<<"Enter age:";

cin>>age;

cout<<"Enter dob:";

cin>>dob;

cout<<"Enter branch:";

cin>>branch;

cout<<"Enter sid:";

cin>>sid;

cout<<"Enter year in college:";

cin>>year;

void display(){

cout<<"Name:"<<name<<endl;

cout<<"Age:"<<age<<endl;

cout<<"DOB:"<<dob<<endl;

cout<<"Branch:"<<branch<<endl;

cout<<"SID:"<<sid<<endl;
cout<<"Year in college:"<<year<<endl;

};

int main(){

stuInfo stud[100];

int N,i;

cout<<"How many records u wish to enter?";

cin>>N;

for(i=0;i<N;i++){

cout<<"Enter details of student "<<i;

stud[i].input();

for(i=0;i<N;i++){

cout<<"Details of student "<<i<< " are as follows:";

stud[i].display();

return 0;

You might also like