Somebody please help me why this program doesn't work properly? If i use scanf instead of fgets then it works fine but the problem with scanf is i cant store a string with space thats why i am using here fgets but after using fgets my program doesn't work. I am attaching my output Screenshot.Code:#include<stdio.h> #include<conio.h> struct student { char name[5][100]; int roll[5]; int sn[5]; int mark[5][5]; } main() { struct student stu; int i,j, sum=0; for(i=0; i<3; i++) { printf("Serial No: "); scanf("%d", &stu.sn[i]); printf("Enter Name: "); fgets(stu.name[i],sizeof(stu.name),stdin); printf("Enter Roll No: "); scanf("%d", &stu.roll[i]); printf("Enter Marks of 5 Subjects:\n"); for(j=0; j<5; j++) { scanf("%d", &stu.mark[i][j]); } printf("\n\n"); } printf("\nPress Enter to Continue\n"); getch(); for(i=0; i<3; i++) { printf("\nSerial No.: %d", stu.sn[i]); printf("\nYour Name: %s", stu.name[i]); printf("\nYour Roll No: %d", stu.roll[i]); printf("\nYour Marks: "); for(j=0; j<5; j++) { printf("\n\t%d", stu.mark[i][j]); sum=sum+stu.mark[i][j]; } printf("\nTotal Marks: %d", sum); sum=0; printf("\n\n"); printf("Press Enter to Continue\n"); getch(); } }