Page 2 of 2 FirstFirst 12
Results 21 to 27 of 27
  1. #21
    Daryn is offline Senior Member
    Join Date
    Oct 2012
    Posts
    177
    Rep Power
    2

    Default Re: I need help storing numbers in loops

    What is it doing wrong?

  2. #22
    MrPosotive is offline Member
    Join Date
    Sep 2012
    Posts
    68
    Rep Power
    0

    Default Re: I need help storing numbers in loops

    thanks man

  3. #23
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default Re: I need help storing numbers in loops

    It's not summing the numbers. Try using 1 and 100 as the two inputs and see if you get 5050 as basic math and Carl Friedrich Gauss would say you should.

  4. #24
    MrPosotive is offline Member
    Join Date
    Sep 2012
    Posts
    68
    Rep Power
    0

    Default Re: I need help storing numbers in loops

    Actually, thanks to all of you that tried to help also

  5. #25
    Daryn is offline Senior Member
    Join Date
    Oct 2012
    Posts
    177
    Rep Power
    2

    Default Re: I need help storing numbers in loops

    no Thats not what i get my code works fine i get the numbers between 1 and 100 although it does reapeat the line"The numbers between 1 and 100 are" but i didnt fix that because i still want him to make little adjusments like that. And then it tells me the sum is 101.

  6. #26
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default Re: I need help storing numbers in loops

    Quote Originally Posted by Daryn View Post
    no Thats not what i get my code works fine i get the numbers between 1 and 100 although it does reapeat the line"The numbers between 1 and 100 are" but i didnt fix that because i still want him to make little adjusments like that. And then it tells me the sum is 101.
    But 101 is not correct. Re-read the requirements of the program please:
    ... the user inputs 2 numbers and it tells you the numbers in between and then i have to find the sum of those numbers,...
    and
    Pretty much if you enter the two numbers 1 and 4 it needs to add the numbers 1,2,3,4 and im not sure how to do that. obviously the sum would be 10 but i dont know how to get it to add them up.
    This means the sum includes each number in between.

  7. #27
    Daryn is offline Senior Member
    Join Date
    Oct 2012
    Posts
    177
    Rep Power
    2

    Default Re: I need help storing numbers in loops

    I still fixed some major errors in the code. All i did was misunderstand the requirements. That does not mean i gave bad advice. it also does not mean my code does not work. it work exactly as i had meant it to.

Page 2 of 2 FirstFirst 12

Similar Threads

  1. help w/ storing/scanning numbers in arrays
    By clemsontigers in forum New To Java
    Replies: 2
    Last Post: 03-30-2011, 06:46 AM
  2. Replies: 20
    Last Post: 03-22-2011, 04:02 AM
  3. Replies: 4
    Last Post: 03-15-2011, 03:58 AM
  4. help w/ storing/scanning numbers in two dimensional arrays
    By clemsontigers in forum New To Java
    Replies: 15
    Last Post: 12-02-2010, 02:08 AM
  5. help w/ storing/scanning numbers in arrays
    By clemsontigers in forum New To Java
    Replies: 15
    Last Post: 11-18-2010, 05:12 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •