That's what I would expect your output to be. If you want to print them out on the same line, you're going to have to save them to an array or a String and wait until after the loop to print them.
Type: Posts; User: KevinWorkman
That's what I would expect your output to be. If you want to print them out on the same line, you're going to have to save them to an array or a String and wait until after the loop to print them.
I'm not sure what you mean by simpler, and I'm not convinced that code does what your example says it does.
How would you do this by hand, without a computer? If somebody tells you a list of numbers, how would you keep adding them up? Write out instructions in English, that you could give to your dumbest...