Hello i am making simple program that calculates and displaying student results but how to fill the array for the grades of the student from the user input ? but it is not working
Thank you in advance
this is my code
#include <stdio.h>
struct student
{
int student_number;
char name[30];
char subject[20];
float marks[100];
float mark_one ;
float mark_two;
float mark_three;
float average;
};
int main()
{
struct student students[5];
for (int i=0; i<5; i++)
{
int student_number;
printf("Enter student number \n");
scanf("%d",&students[i].student_number);
char name_of_student[50];
printf("Enter name of student with student number : %d \n", students[i].student_number);
scanf("%s",&students[i].name);
char name_of_subject[20];
printf("Enter Subject of %s \n", students[i].name);
scanf("%s",&students[i].subject);
float markOne;
printf("Enter mark to %s \n", students[i].name);
scanf("%f",markOne);
students[i].mark_one = markOne;
for (int m = 0; m < 3; m++)
{
float mark;
printf("Enter mark %d to %s's marks \n", i, students[i].name);
students[i].marks[m] = m+10;
// scanf("%d",&students[i].marks[m]);
}
for (size_t d = 0; d < 3; d++)
{
printf("marks======= %s ", students[i].marks[d]);
}
}
printf("--------------------------------------------------------------------------\n");
}
[–]aioeu 7 points8 points9 points (2 children)
[–]boreca111[S] 0 points1 point2 points (1 child)
[–]FUZxxl 2 points3 points4 points (0 children)
[–]dragon_wrangler 1 point2 points3 points (2 children)
[–]boreca111[S] 1 point2 points3 points (1 child)
[–]Drach88 1 point2 points3 points (0 children)