User Profile
Collapse
Profile Sidebar
Collapse
hanslo91
Last Activity: Apr 29 '14, 05:37 PM
Joined: Apr 29 '14
Location:
-
Oh man I can't believe it! Thank you Rabbit, it worked and I can move onto the next course finally! Thanks again! -
Ok thanks Rabbit! I see that error now which I consitantly overlooked. I switched those two lines but now im having the issue where it isnt adding to what it should which is 500500....Code:public class Main { public static void main(String[] args) { int sum = 0; int i = 1; while (i <=1000) { System.out.println(sum); sum = sum + i; i++;Leave a comment:
-
am trying my best I am working within a leanring app and it keeps telling me I have the incorrect result. The new program that I put in after reading your comment is,
...Code:public class Main { public static void main(String[] args) { int sum = 0; int i = 1; while (i <=1000) { System.out.println(sum); i++; sum = sum +Last edited by Rabbit; Apr 29 '14, 03:22 PM. Reason: Please use [code] and [/code] tags when posting code or formatted data.Leave a comment:
-
While loop calculating the sum of all numbers from 1 - 1000
} am stuck here I have tried using a seperate interger but I cant seem to figure this out! Please help.Code:public class Main { public static void main(String[] args) { int sum = 0; while (sum <=1000) { System.out.println(sum); sum++; } }Last edited by Rabbit; Apr 29 '14, 03:22 PM. Reason: Please use [code] and [/code] tags when posting code or formatted data.
No activity results to display
Show More
Leave a comment: