# I am beginner in Programming. Please help what is my mistake? Why Total Marks and Percentage is not coming correctly?

I am beginner in Programming. Please help what is my mistake?? Why Total Marks and Percentage is not coming correctly??

``````#include <stdio.h>
struct student
{
int Student_Id;
int English, Urdu, Mathematics, Total_Marks;
float Percentage;
};
int main()
{
struct student stud[5];
int i, English, Urdu, Mathematics, Total_Marks, Percentage;
for(i=0; i<4; i++)
{
printf("\nStudent %d\n\n",i+1);
printf("Enter Student ID :  ");
scanf("%d", &stud[i].Student_Id);
printf("Enter English Marks :  ");
scanf("%d", &stud[i].English);
printf("Enter Urdu Marks :  ");
scanf("%d", &stud[i].Urdu);
printf("Enter Mathematics Marks :  ");
scanf("%d", &stud[i].Mathematics);
Total_Marks = English+Urdu+Mathematics;
Percentage = Total_Marks/300;

}
for(i=0; i<4; i++)
{
printf("\nStudent %d\n\n",i+1);
printf("Student ID :  %d \n", stud[i].Student_Id);
printf("English Marks :  %d \n", stud[i].English);
printf("Urdu Marks :  %d \n", stud[i].Urdu);
printf("Mathematics Marks :  %d \n", stud[i].English);
printf("Total Marks :  %d \n", stud[i].Total_Marks);
printf("Percentage :  %f \n", stud[i].Percentage);

}
return 0;
}
``````

Welcome to the forum.

Remember, you need to set the `Total_Marks` and `Percentage` for a particular `student` struct. Youâ€™re missing `stud[i]`.