0
33kviews
Write a program to store the name, roll number and marks in three subjects of n students using structure. Generate a merit list with respect to the total marks scored.
1 Answer
3
3.3kviews
#include<stdio.h>
struct student
{
char name[20];
int roll_no;
int physics,chem,maths,total;
};
void main ()
{
struct student s[100],temp;
int n,i,j;
clrscr();
printf("Enter the number of students");
scanf("%d",&n);
for(i=0;i<=n-1;i++)
{
    printf("Enter the student's name, roll      number and marks in three subjects:");
    scanf("%s %d %d %d %d",s[i].name,   &s[i].roll_no,&s[i].physics,&s[i].chem,&s[i].maths; s[i].total=s[i].physics+s[i].chem+s[i].maths;
}
for(i=0;i<=n-1;i++)
{ …

Create a free account to keep reading this post.

and 2 others joined a min ago.

Please log in to add an answer.