Wednesday, October 19, 2011

Program:To illustrate the use of structures in c++




Structures in c++
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();
}

Article by
Chief-Editor

He is a tech Enthusiast, an Altruist and calm mentor. He loves to code. He is also a creative graphic designer. Do check out his designfolio @ Jasmeet.asia If you like This post, you can follow me on Twitter.



For Further Reading,
C++ Program

0 comments:

Post a Comment