In This case space after %d is format specifier so it’s take 2 argument with space as separator.
scanf("%d %d", &marks[i], &marks[i+1]); => 1 2
scanf("%d ", &marks[i]); => 1 2
scanf("%d", &marks[i]); => 1
solved Why is scanf being performed 11 times?