View Single Post
  #1 (permalink)  
Old 07-25-2007, 08:56 PM
susan susan is offline
Member
 
Join Date: Jul 2007
Posts: 44
susan is on a distinguished road
Print a blank space
Hi, i was trying out a simple program using loops displaying the "*" sign
line by line with space after each line.
however, i would like to try displaying the output in the other way instead
but not sure how ... Can anyone guide me and pin point it to me?
And i wonder why my blank space line some are so wide apart and some
are not??

My current output looks like this:
Code:
* ** *** **** *****
notice there is such big gabs but not the last 2 lines....did i wrote
something wrong?

I would like to display the asteric sign "*"
to the right side instead left side like above.

This is my coding

Code:
public class exercise2 { public static void main(String args[]) { int currwidth; for (int i=0; i<6; i++) { currwidth = 6 - i; for (int x=0; x<currwidth; x++) { System.out.println(" "); } for (int y=0; y<i; y++) { System.out.print("*"); } } } }
Thanks
Reply With Quote
Sponsored Links