Ok, thank you I figured it out,
int total = 0
needs to be befor the loop and I needed to use the total inside the loop to keep a running total adding n to it each time.
User Profile
Collapse
-
Running totals of variables in a loop.
Hey I am having trouble with loops the problem is as follows;
My program so far gets me to what I need which is the remainders which are the last digits of the 5 digit number inputted, I need a way for java to keep a running sum of all the remainders and then I need a new variable which is the sum of the remainders after going through the loop.
Any help is greatly appreciated.
mport java.util.Scann er;
...
No activity results to display
Show More
Leave a comment: