Your problem is not the starting of the for loop but it is the ending of the for loop
in your for loop it is correct that you start at one and if you wanted the begining of the array you would start at zero however at the end you state less than five which would mean it stops at four your array however is assigned 4 values that would be grades[0-3] which means you must state that the loop stops at less than four so that the unnassigned variable isnt used thats why your average is all messed up
~ Geo
~ Don't take life too seriously, you'll never get out alive!
|