Im trying to shorten a bit of code,
Code:
printf("Please enter your students exam mark seperated by a space\n");
scanf("%d %d %d %d %d %d %d %d %d %d", &grade[1], &grade[2], &grade[3], &grade[4], &grade[5], &grade[6], &grade[7], &grade[8], &grade[9], &grade[0]);
The code works but its a bit annoying having all of these different variables like this in another bit of code ive used a for loop,
Code:
for (i=0; i<10; i++){
sum += grade[i];
}
This adds up all the variables. I was wondering if there was something like this is could use in my scanf function.
Thanks.