Persistent Systems Interview Question

To write the code to create the following pattern. 55555 4444 333 22 1

Interview Answer

Anonymous

Aug 4, 2021

for (int i=n; i>0;i--){ int j=i; while (j>0) { System.out.println(i); j--; } }

1