TEX] I have this code but can not get it to display the numbers the way i want.
I want the display
1
21
.
.
.
n-2)......1
(n-1).......1
n (n-1)... 21
My code is[/TEX]
public class print{
public static void parttens()
{ int w=4,t=0;
int k = 1;
int[]array=new int[5];
for(int i=0;i<5;i++)
{
array[i]=k++;
}
for (int r=0;r<=4;r++)
{
for (int i=r;i>=0;i--)
{
System.out.print(array[i]);
}
System.out.println();
}
}
public static void main(String []args)
{
parttens();
}
}
can you help me get the correct printout