I need my code to start at 1 and go to 9999. If the code meets the first if-statement it'll go on. If not, than it will start over and add 1 on to the previous number tried. This is what I have now.
Try not to give me answers, just show me where i'm going wrong at as this is a homework assignment. Thank you!
Yes, first thing is that you need to make sure that everything below the while loop is executed at every iteration of the loop. As of now only line 11 is being executed and nothing else.
Next you need to make sure you are computing the right sum, your code and your post say 2 different things
Finally using a for-loop will make your code more compact so that the unnecessary else address++ is done only once