Skip to content

Instantly share code, notes, and snippets.

@viveknarang
Created September 27, 2017 02:48
Show Gist options
  • Save viveknarang/41cc5bfc09c79bc0257c5fe6dd2a6666 to your computer and use it in GitHub Desktop.
Save viveknarang/41cc5bfc09c79bc0257c5fe6dd2a6666 to your computer and use it in GitHub Desktop.
public class NestedLoop {
public static void main (String [] args) {
int userNum = 0;
int i = 0;
int j = 0;
/* Your solution goes here */
for (i = 0; i <= userNum; i++) {
for (j = 0; j < i; j++) {
System.out.print(" ");
}
System.out.println(i);
}
return;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment