What's the error in this program..i get student data and print maximum total marks
#include<stdio.h> #include<conio.h> struct student { char name[20]; int rollno; int mark[4]; int sum; }s[100],a; void main() { int i,j,k,n,s[i].sum=0; printf("enter no of students"); scanf("%d",&n); for(i=0;i<n;i++) { printf("enter name"); gets(s[i].name); printf("enter roll no"); scanf("%d",s[i].rollno); printf("enter marks"); for(j=0;j<4;j++) { scanf("%d",s[i].mark[j]); } printf("..................\n"); } for(i=0;i<n;i++) { for(j=0;j<4;j++) {s[i].sum=s[i].sum+s[i].mark[j]; } } for(i=0;i<n;i++) { for(j=i+1;j<n;i++) { if(s[i].sum<s[j].sum) { a=s[i]; s[i]=s[j]; s[j]=a; } } } printf("max mark is %d",s[0].sum); getch(); }