Structures in c++
CODE:
CODE:
#include<iostream.h>
#include<conio.h>
struct biodata
{
char name[80];
int rollno;
int marks;
};
void main()
{
clrscr();
biodata student[50];
cout<<"Enter boidata of 50 students"<<endl;
for (int i=0;i<=49;i++)
{
cout<<"Enter name";
cin>>student[i].name;
cout<<"Enter roll_no."<<endl;
cin>>student[i].rollno;
cout<<"Enter marks"<<endl;
cin>>student[i].marks;
}
for(i=0;i<=49;i++)
{
cout<<"Name:"<<student[i].name<<endl;
cout<<"Roll no:"<<student[i].rollno<<endl;
cout<<"Marks:"<<student[i].marks<<endl;
}
getch();
}
For Further Reading,
0 comments:
Post a Comment