Okay so I have been learning C++(obviously beginner) for a few monthsand my Prof. gave me a problem definition which states:
Print a the selected amount of quiz scores, with the average,highest and lowest number.
So i got it to work with the average but couldn't get the highest and lowest right so now I scoured the net on how it works, problem is what I got was the code itself and not an explanation on its logic so yeah, Need some advice on that
(This is with Codeblocks incase you were wondering)
18|warning: statement has no effect [-Wunused-value]|
when compiling with CodeBlocks because of this line:
for(x;x<=z;x++)
because there is no need to put for (x;...) if you don't want to initialize variable there. You can put for (; ...) or for (x = 1; ...) to remove that warning if you get it too.
Can't you just say avg = sum / z, I mean, there is no need for counter variable?