Results 1 to 2 of 2

Thread: Nested For Loop

  1. #1
    yuchuang is offline Member
    Join Date
    Apr 2007
    Rep Power

    Default Nested For Loop

    Hi, anyone knows how to use nested for loop to create this pattern?
    I wanted to create a pattern that looks like a pyramid. The first line has 1 star, follow by 2nd line 3 stars and so forth. Every line has stars that are odd numbers.

    Last edited by yuchuang; 07-08-2007 at 05:19 AM.

  2. #2
    JavaBean's Avatar
    JavaBean is offline Moderator
    Join Date
    May 2007
    Rep Power


    Hi Yuchuang,

    Please check following thread:

    I already advised a nested loop to solve a problem very similar to yours. To solve your problem, you just need to play with the loop parameters. Play with it and paste your code here if you can't solve your problem. But it is easy, you should be able to solve it.

Similar Threads

  1. Getting unmarshaling return; nested exception
    By K.kannan in forum Advanced Java
    Replies: 0
    Last Post: 03-27-2008, 08:04 AM
  2. foreach in jstl to display nested colums-struts jsp
    By adil7 in forum JavaServer Pages (JSP) and JSTL
    Replies: 1
    Last Post: 02-11-2008, 06:19 AM
  3. Breaking from nested switch
    By javaplus in forum New To Java
    Replies: 3
    Last Post: 02-02-2008, 08:28 AM
  4. Nested loops?
    By gabriel in forum New To Java
    Replies: 4
    Last Post: 08-06-2007, 04:51 PM
  5. Nested Tags JSP
    By Marcus in forum JavaServer Pages (JSP) and JSTL
    Replies: 1
    Last Post: 06-25-2007, 05:42 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