RUPAK SEARCH ENGINE

Custom Search

Get roll, name and two subjects marks of n students in a structure and display it.

Get roll, name and two subjects marks of n students in a structure and display it.
#include
#include
void main()
{
int i,n;
struct mydatatype{
int roll;
char sname[20];
int comp,eng;
};
struct mydatatype student[80];
clrscr();
printf("\nHou many students?");
scanf("%d",&n);
for(i=0;in;i++) //insert less than sign
{
printf("\nSN %d:",i+1);
printf("\nRoll:");
scanf("%d",&student[i].roll);
printf("Name:");
scanf("%s",student[i].sname);
printf("Computer:");
scanf("%d",&student[i].comp);
printf("English:");
scanf("%d",&student[i].eng);
}
printf("\nStudent List");
printf("\nRN\t\tNAME\tCOMPUTER\tENGLISH");
for(i=0;in;i++) //insert less than sign
{
printf("\n%d",student[i].roll);
printf("\t\t%s",student[i].sname);
printf("\t\t%d",student[i].comp);
printf("\t\t%d",student[i].eng);
}
getch();}

No comments:

Post a Comment