Click to See Complete Forum and Search --> : help please


MrBoomin'Granny
03-23-2003, 03:18 PM
Ok so i am trying to make a simple program run this

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

ok but all the asteriks are alligned on the right side, like a right triangle.
so far i have this
public class exercise5c{

public static void main(String args[])
{

for(int row=1;row<=10;row++)

{
for (int ast=1;ast<=row;ast++)
System.out.print(' ');
System.out.print('*');
System.out.println();


}

System.exit(0);


}
}

and that produces this but diagonal to the right and down.
*
*
*
*
*
*
*
*
*
*
*

what am i doing wrong? i can't figure it out. thanks

dabush
03-23-2003, 03:38 PM
this is the javascript forum

eggman
03-23-2003, 03:49 PM
Your program is doing exactly what it was told to do.

Try it without the following line:

System.out.print (" ");

or, if you need to keep the space:

System.out.print ("* ");