We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Write a c program to input n student details & display the output #include<stdio.h> #include<conio.h> struct student { char student_name[25],stream[5]; int roll_no,m1,m2,m3,m4,total; float avg; }; void main() { int n,i; printf("Enter Number of student:"); scanf("%d",&n); struct student stud[n]; printf("Enter student Details"); for (i=0;i<n;i++) { fflush(stdin); printf("\nEnter student name:"); gets(stud[i].student_name); printf("\nEnter Roll no:"); scanf("%d",&stud[i].roll_no); fflush(stdin); printf("\nEnter stream:"); gets(stud[i].stream); printf("\nEnter Marks in 4 subject:"); scanf("%d %d %d %d",&stud[i].m1,&stud[i].m2,&stud[i].m3,&stud[i].m4); stud[i].total=stud[i].m1+stud[i].m2+stud[i].m3+stud[i].m4; stud[i].avg=stud[i].total/4; } printf("\n STUDENT NAME ROLL NO STRAEM SUB1 SUB2 SUB3 SUB4 TOTAL AVG\n"); for (i=0;i<n;i++) { printf("\n %s %d %s %d %d %d %d %d %.2f",stud[i].student_name,stud[i].roll_no,stud[i].stream,stud[i].m1,stud[i].m2,stud[i].m3,stud[i].m4,stu d[i].total,stud[i].avg); } }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Write a c program to input n student details & display the output
#include<stdio.h>
#include<conio.h>
struct student
{
char student_name[25],stream[5];
int roll_no,m1,m2,m3,m4,total;
float avg;
};
void main()
{
int n,i;
printf("Enter Number of student:");
scanf("%d",&n);
struct student stud[n];
printf("Enter student Details");
for (i=0;i<n;i++)
{
fflush(stdin);
printf("\nEnter student name:");
gets(stud[i].student_name);
printf("\nEnter Roll no:");
scanf("%d",&stud[i].roll_no);
fflush(stdin);
printf("\nEnter stream:");
gets(stud[i].stream);
printf("\nEnter Marks in 4 subject:");
scanf("%d %d %d %d",&stud[i].m1,&stud[i].m2,&stud[i].m3,&stud[i].m4);
stud[i].total=stud[i].m1+stud[i].m2+stud[i].m3+stud[i].m4;
stud[i].avg=stud[i].total/4;
}
printf("\n STUDENT NAME ROLL NO STRAEM SUB1 SUB2 SUB3 SUB4 TOTAL AVG\n");
for (i=0;i<n;i++)
{
printf("\n %s %d %s %d %d %d %d %d
%.2f",stud[i].student_name,stud[i].roll_no,stud[i].stream,stud[i].m1,stud[i].m2,stud[i].m3,stud[i].m4,stu
d[i].total,stud[i].avg);
}
}
The text was updated successfully, but these errors were encountered: