123456789101112131415161718192021222324252627282930
#include<stdio.h> #include<conio.h> #include<string.h> struct student { int id; char name[200]; float percentage; }; int main() { int n; struct student record[2]; for(n=0;n<3;n++) { printf("Enter student ID, name, and percentage respectively: \n"); scanf("%d\n",&record[n].id); scanf("%s\n",record[n].name); scanf("%f\n",&record[n].percentage); } for(int n=0;n<3;n++) { printf("Student ID %d \n",record[n].id); printf("Student name %s \n",record[n].name); printf("Student percentage %f \n",record[n].percentage); } getch(); return 0; }
getch();