View Single Post
  #5 (permalink)  
Old 01-22-2008, 12:31 AM
CaptainMorgan's Avatar
CaptainMorgan CaptainMorgan is offline
Moderator
 
Join Date: Dec 2007
Location: NewEngland, US
Posts: 841
CaptainMorgan will become famous soon enoughCaptainMorgan will become famous soon enough
Send a message via AIM to CaptainMorgan
Welcome to the Java Forums. I appreciate you making a valid attempt at your work.

When working out code like this, there is no better way to get this structure into your head(when you are first starting out), than to get a pencil and a piece of paper and draw out what exactly is going on. Also, choose your variable names wisely.. I changed it to lowercase i because I couldn't figure out if you were using uppercase I, lowercase L or a number one. Cheers.

Please use code tags.
Code:
int num = 5; int spaces = 5; for(int i = 0; i < num; i++) { for (int a = spaces - 1; a > 0; a--) System.out.print(" "); for (int x = 0; x <= i; x++) { System.out.print("*"); } System.out.println(); spaces--; }
See you around!
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
to our beloved Java Forums!
(closes on September 4, 2008)
Want to voice your opinion on your IDE/Editor of choice?
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
!
Got a little Capt'n in you? (drink responsibly)

Last edited by CaptainMorgan : 01-22-2008 at 12:33 AM.
Reply With Quote