Linked Questions

Popular Questions

    5
   54
  543
 5432
54321

I tried to print the pattern above using the following for loop but I don't know why it's not working,

for(int i = 0;i<=5;i++,count = 1,System.out.println()){
    for(int j = 5;j>=i;j--)
    {
        System.out.print("");
    }
    for (int k = 5;count <=i;count++,k--)
    {
        System.out.print(k+"");
    }

Related Questions