Results 1 to 2 of 2
  1. #1
    ts96 is offline Member
    Join Date
    Feb 2011
    Rep Power

    Default basic while loops

    Im trying to write out the code for these while loops, can you show me how to do these.

    1) “while counter is less than 50, then increase it by one”

    2) “while x is less than y and is not zero, divide x in half”

    attempt at solution:

    1) while (counter<50)

    2) while (x<y && x!=0)

  2. #2
    goldest's Avatar
    goldest is offline Senior Member
    Join Date
    Oct 2009
    Pune, India
    Rep Power


    So far, so good.

    What happened when you tried that inside your code? Or is this just another quiz?

    Java Is A Funny Language... Really!
    Click on * and add to member reputation, if you find their advices/solutions effective.

Similar Threads

  1. Basic loops
    By Samari413 in forum New To Java
    Replies: 13
    Last Post: 11-14-2010, 01:19 AM
  2. While Loops, need a bit of help.
    By Keno777 in forum New To Java
    Replies: 7
    Last Post: 10-30-2009, 08:24 PM
  3. these loops...
    By Blaedel in forum New To Java
    Replies: 0
    Last Post: 10-01-2009, 06:59 PM
  4. how to use do while loops
    By mikeitalydz in forum New To Java
    Replies: 32
    Last Post: 09-26-2009, 08:30 PM
  5. Loops (while do etc)
    By manupr in forum New To Java
    Replies: 1
    Last Post: 01-15-2008, 03:59 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