C++ Program .Write a program to accept the information of five students such as roll no,name, and address.And display the information using structures.


#include<stdio.h>
#include<conio.h>
void main()
{
 struct student
               {
               int rollno;
               char sname[21];
               char address[53];
               }stud[5];
int i;
clrscr();
printf("\n Enter student information");
for(i=0;i<5;i++)
 {
 printf("\n Enter roll no-");
 scanf("\n %d",&stud[i].rollno);

 printf("\n Enter the student name-");
 scanf("\n %s",stud[i].sname);

 printf("\n Enter the address-");
 scanf("\n %s",&stud[i].address);
 }
printf("\n The student information");

for(i=0;i<5;i++)
 {
 printf("\n roll no is-%d",stud[i].rollno);
 printf("\n name is -%s",stud[i].sname);
 printf("\n address is -%s",stud[i].address);
 }

getch();
}
/* Output
 Enter student information

 Enter roll no-153
 Enter the student name-sanjay
 Enter the address-baramati

 Enter roll no-149
 Enter the student name-sachin
 Enter the address-lonibhapkar

 Enter roll no-135
 Enter the student name-pramod
 Enter the address-supe

 Enter roll no-111
 Enter the student name-ranjit
 Enter the address-satara

 Enter roll no-130
 Enter the student name-chetan
 Enter the address-malegaon

 The student information

 roll no is -153
 name is -sanjay
 address is -baramati

 roll no is -149
 name is -sachin
 address is -lonibhapkar

 roll no is -135
 name is -pramod
 address is -supe

 roll no is -111
 name is -ranjit
 address is -satara


 roll no is -130
 name is -chetan

 address is –malegaon */