What am I doing wrong that when my studentCounter & totalPassedCounter outputs, there's always one extra? Is that because I initalized number to = 1 to start? How could I go about fixing this?
Yes, you started out with 1 that didn't correspond to a student passing. I think I'd initialize the variable to 0 and restructure how the code loops.
For example, what are you expecting to happen if someone enters a 1 in this loop? i.e. they enter a passing grade after a failing grade? It's not going to jump back to the previous while.
Why are you incrementing studentCounter and totalPassedCounter before you've ever asked the user for the first result?
Because I'm new to C, and trying to learn. It's the same reason I asked for help in the first place. Forgive me for being under the "Beginner" section of the site.
Yes, you started out with 1 that didn't correspond to a student passing. I think I'd initialize the variable to 0 and restructure how the code loops.
Because I'm new to C, and trying to learn. It's the same reason I asked for help in the first place. Forgive me for being under the "Beginner" section of the site.
Um, I meant that as a genuine question. For all I know, you had a particular reason for wanting to do it that way. There's no need to be defensive.