int sum = 0; for (int i = 0; i <= 1000; i=i+2) sum += i; System.out.println(sum);For my while loop this is the best I have come up with and I am unable to get it to compile.
int sum = 0;
int i = 0;
while (i < 1000); {
i=i+2;sum += i;
System.out.println(sum);
}
Any help would be greatly appreciated!!!
Edited by yourmom615, 12 March 2011 - 04:35 PM.


Sign In
Create Account


Back to top









