#include<iostream.h>

#include<conio.h>

struct student

{

int rollno;

char name[20];

int marks;

};

void main()

{

student std[10];

int i,n;

cout<<“Enter the no. of students”;

cin>>n;
cout<<“Enter the values:”;

for(i=0;i<n;i++)

{

cout<<“Enter the Roll no.”;

cin>>std[i].rollno;

cout<<“Enter the Name”;

cin>>std[i].name;

cout<<“Enter the marks”;

cin>>std[i].marks;

}

cout<<“Display the values”;

for(i=0;i<n;i++)

{

cout<<std[i].rollno<<‘\t’;

cout<<endl<<std[i].name<<‘\t’;
cout<<endl<<std[i].marks<<‘\t’;
}

getch();

}

Advertisements