Yes, your code has small logical mistake.
first scanf is for getting the student name, so scores[i] is enough but you have used
Code:
scanf("%s",scores[i][j]);
See the following code.
Code:
#include<stdio.h>
#include<stdlib.h>
main()
{
char scores[10][5]; // i just edit this
int i,j;
for(i=0;i<5;i++)
{
printf("\nEnter student %i",i+1);
scanf("%s",scores[i]); // is this wrong should i just scanf score[i] only
for(j=0;j<2;j++)
{
printf("\n\t\tenter the score");
scanf("%i",&scores[i][j]);
}
}
}
Output:
Code:
Enter student 1 s1
enter the score 70
enter the score 45
Enter student 2 s2
enter the score 55
enter the score 78
Enter student 3 s3
enter the score 89
enter the score 78
Enter student 4 s4
enter the score 78
enter the score 90
Enter student 5 s5
enter the score 90
enter the score 80