Write a c program to accept and display details of one student (roll no , name,percentage) using structure
Answers
Answered by
0
Answer:
Accept and display data for three students.
#include<stdio.h>
#include<conio.h>
void main() {
int i;
struct student{
int rollno;
char name[20];
int marks;
} s[3];
clrscr();
for(i=0;i<3;i++) {
printf("Enter rollno, name and marks\n");
scanf("%d%s%d",&s[i].rollno,&s[i].name,&s[i].marks);
}
for(i = 0; i<3;i++){
printf("\nThe details of student %d\n",i+1);
printf("Roll no %d\n",s[i].rollno);
printf("Name is %s\n",s[i].name);
printf("Marks %d\n",s[i].marks);
}
getch();
Similar questions