i have done the following program of student information.
when we run the program we enter details of all the 10 students
and get output details of all the 10students.
now if we come out of the program i.e execution of program is completed and again we come to the sourse code of the program.
now my question is what should i do if i have to view the details of
all the 10 students whose information i have entered earlier?
is this information (details of 10 students) get stored anywhere?
when we run the program we enter details of all the 10 students
and get output details of all the 10students.
now if we come out of the program i.e execution of program is completed and again we come to the sourse code of the program.
now my question is what should i do if i have to view the details of
all the 10 students whose information i have entered earlier?
is this information (details of 10 students) get stored anywhere?
Code:
#include<stdio.h> #include<conio.h> struct student { char name[20]; int roll,age; }; main() { int i; struct student S[10]; clrscr(); for(i=0;i<3;i++) { printf("\nEnter the details of the student : "); scanf("%s %d %d",S[i].name,&S[i].roll,&S[i].age); } clrscr(); printf("\nThe details of the student are\n"); for(i=0;i<3;i++) { printf("\n%s \n%d \n%d\n\n",S[i].name,S[i].roll,S[i].age); } getch(); return 0; }
Comment