Seeing dollars in your future

  • 4
If you open this task at midnight, take a while loop, and display a 10x10 square of dollar signs, then you'll learn to use a while loop to display a 10x10 square of dollar signs. You shouldn't expect untold riches to immediately follow. But if you keep completing these tasks, they almost certainly will.
You can't complete this task, because you're not signed in.
  • Popular
  • New
  • Old
You must be signed in to leave a comment
Sean NigitoLevel 4 , Newark
day before yesterday, 22:09
Did anyone do this task at midnight
SoundaryaLevel 6
15 January 2019, 05:51
import*; public class Solution { public static void main(String[] args) throws Exception { //write your code here int i=10; int j=10; while(i>=1){ while(j>=1){ //for(j=10;j>=1;j--){ System.out.print("$"); j--; } i--; System.out.println(); } } } Whats wrong with the logic??..its working fine with for loop..but not with while loop The code worked fine when I initialized j value before the start of second while loop. But why cant it work wen initialized in the beginning
RomanLevel 41
15 January 2019, 07:05
If you need help, something isn't right in your code, the server won't accept your solution (even if you are 100% sure that it is correct). Describe your question/issue in the HELP section at
ZserboLevel 22 , Budapest
8 June 2019, 22:21
you have to reset j value after every outer (i) iteration