Results 1 to 5 of 5
  1. #1
    Join Date
    Sep 2011
    Posts
    2
    Rep Power
    0

    Default help me for this nested for loop with users input

    i dont know how to put the user's input with this..when i run this it automatically runs without asking how many asterisk..im new in java :(

    int x,y;
    for(x=5;x>=1;x--)
    {
    for(y=1;y<=1;y++)
    {System.out.print("*");}
    {System.out.println("");}
    }
    }
    }
    the output of this is

    *****
    ****
    ***
    **
    *

    i want the output is

    Enter number:
    (then it depends on the number in how many asterisk are there)

  2. #2
    liluma's Avatar
    liluma is offline Member
    Join Date
    May 2011
    Location
    belgium
    Posts
    50
    Rep Power
    0

    Default Re: help me for this nested for loop with users input

    you could say what are your probs... (since like said indeed it's not the intention to just give the code, forgat that;.. :( )

    and do try not to doublepost things...

    grtz liluma
    Last edited by liluma; 09-06-2011 at 03:52 PM.

  3. #3
    Tolls is online now Moderator
    Join Date
    Apr 2009
    Posts
    12,087
    Rep Power
    20

    Default Re: help me for this nested for loop with users input

    Please don't spoonfeed code to people.
    It's not what this forum is here for.

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

    Default Re: help me for this nested for loop with users input

    Quote Originally Posted by jakemanalaotao View Post
    int x,y;
    for(x=5;x>=1;x--)
    {
    for(y=1;y<=1;y++)
    {System.out.print("*");}
    {System.out.println("");}
    }
    }
    }
    the output of this is

    *****
    ****
    ***
    **
    *
    How remarkable ...

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  5. #5
    liluma's Avatar
    liluma is offline Member
    Join Date
    May 2011
    Location
    belgium
    Posts
    50
    Rep Power
    0

    Default Re: help me for this nested for loop with users input

    Quote Originally Posted by Tolls View Post
    Please don't spoonfeed code to people.
    It's not what this forum is here for.
    changed post.

    your right... shouldn't just give him the code...

Similar Threads

  1. Nested Loop
    By sehudson in forum New To Java
    Replies: 2
    Last Post: 03-11-2011, 03:39 AM
  2. extract time from users input
    By darshna in forum New To Java
    Replies: 2
    Last Post: 02-12-2010, 12:07 PM
  3. can some one help me with nested loop?
    By keycoffee in forum New To Java
    Replies: 10
    Last Post: 01-25-2010, 02:49 AM
  4. problem with Scanner in Getting users input
    By kliane in forum New To Java
    Replies: 8
    Last Post: 01-17-2010, 04:37 PM
  5. Nested For Loop
    By yuchuang in forum New To Java
    Replies: 1
    Last Post: 07-08-2007, 01:11 PM

Posting Permissions

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