User Profile

Collapse

Profile Sidebar

Collapse
hanslo91
hanslo91
Last Activity: Apr 29 '14, 05:37 PM
Joined: Apr 29 '14
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Oh man I can't believe it! Thank you Rabbit, it worked and I can move onto the next course finally! Thanks again!
    See more | Go to post

    Leave a comment:


  • 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++;
    ...
    See more | Go to post

    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 +
    ...
    See more | Go to post
    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

    Code:
    public class Main
    {
    	public static void main(String[] args)
    	{
    		int sum = 0;
    		while (sum <=1000)
    		{
    				System.out.println(sum);
    				sum++;
    		}
    		
    		
    	}
    } am stuck here I have tried using a seperate interger but I cant seem to figure this out! Please help.
    See more | Go to post
    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
Working...