Write a c program to store and display roll number and marks of any 5 students using structure. (12)
#include<stdio.h>
#include<conio.h>
struct
student
{
int
roll, marks;
};
void
main()
{
int i;
struct
student s[5];
for(i=0;i<5;i++)
{
printf("Enter
roll");
scanf("%d",
&s[i].roll);
printf("Enter
marks");
scanf("%d",
&s[i].marks);
}
for(i=0;i<5;i++)
{
printf("roll
no. %d", s[i].roll);
printf("marks
%d", s[i].marks);
}
getch();
}
Comments
Post a Comment