Results 1 to 3 of 3
Like Tree1Likes
  • 1 Post By JosAH

Thread: a certain output

  1. #1
    begin is offline Member
    Join Date
    Jul 2012
    Posts
    1
    Rep Power
    0

    Default a certain output

    hello,

    i am a beginner and i could use some help using the while and if statements. I need this output: 0-1-2-3-4-5-6-7-8-9

    what is the code?

    Thank you

  2. #2
    awinston is offline Student
    Join Date
    Jul 2012
    Location
    United States
    Posts
    328
    Rep Power
    3

    Default Re: a certain output

    Quote Originally Posted by begin View Post
    what is the code?
    I'm sorry, but this isn't a place to ask for code. If you need help with while and if statements, I can direct you to these tutorials: The if-then and if-then-else Statements (The Java™ Tutorials > Learning the Java Language > Language Basics) + The while and do-while Statements (The Java™ Tutorials > Learning the Java Language > Language Basics)

    Judging from your question, you will probably find this helpful as well: The for Statement (The Java™ Tutorials > Learning the Java Language > Language Basics)
    "Success is not final, failure is not fatal: it is the courage to continue that counts." - Winston Churchill

  3. #3
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,371
    Blog Entries
    7
    Rep Power
    20

    Default Re: a certain output

    Quote Originally Posted by begin View Post
    hello,

    i am a beginner and i could use some help using the while and if statements. I need this output: 0-1-2-3-4-5-6-7-8-9

    what is the code?
    There is no one-to-one correspondence between the output of a program and the code that produced it, so asking for the code doesn't make sense; here, this code has it all:

    Java Code:
    if (true)
       while (true) {
          System.out.println("0-1-2-3-4-5-6-7-8-9");
          break;
       }
    ... but I doubt you had this in mind.

    kind regards,

    Jos
    DarrylBurke likes this.
    cenosillicaphobia: the fear for an empty beer glass

Similar Threads

  1. Replies: 2
    Last Post: 05-03-2012, 11:39 AM
  2. Replies: 0
    Last Post: 09-30-2010, 08:16 PM
  3. output
    By yrollgayanth in forum New To Java
    Replies: 5
    Last Post: 12-30-2009, 05:05 PM
  4. Java, output string, getting correct output? HELP!
    By computerboyo in forum New To Java
    Replies: 2
    Last Post: 02-25-2009, 11:44 PM
  5. how to c the output
    By pro85 in forum Java Applets
    Replies: 1
    Last Post: 02-11-2009, 09:09 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
  •