Skip to content

Instantly share code, notes, and snippets.

@singhrahuldps
Last active April 27, 2020 13:39
Show Gist options
  • Select an option

  • Save singhrahuldps/3d192117d1255a535334eff01bcb0c90 to your computer and use it in GitHub Desktop.

Select an option

Save singhrahuldps/3d192117d1255a535334eff01bcb0c90 to your computer and use it in GitHub Desktop.
// Print a pyramid pattern using for loop
for(int i = 1; i <= 5; i++) {
for(int j = 1; j <= i; j++) {
System.out.printf("%d ", j);
}
System.out.print("\n");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment