To add to what Richard has said, the
problem is pretty obvious. Look at your output:
Round 0 score: 95/100
Look at the code that generates it:
printf(" Round %d score: %d/100\n", rounds, g); ...
printf(" Average score: %f\n", avg);
So we know that
Look at the code to generate
avg = allScore / rounds;
And you immediately see the source of the
value: division by zero.
To be honest, thirty seconds with the debugger would have shown you that!