From b0a79949c94d1b6f3a49a0b8360628c97c32c09f Mon Sep 17 00:00:00 2001 From: RITA-HITECH <42319102+RITA-HITECH@users.noreply.github.com> Date: Wed, 28 Oct 2020 12:32:03 +0530 Subject: [PATCH] Create half pyramid program Program to print half pyramid a using numbers --- half pyramid program | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 half pyramid program diff --git a/half pyramid program b/half pyramid program new file mode 100644 index 0000000..1e413fc --- /dev/null +++ b/half pyramid program @@ -0,0 +1,13 @@ +public class Pattern { + + public static void main(String[] args) { + int rows = 5; + + for(int i = 1; i <= rows; ++i) { + for(int j = 1; j <= i; ++j) { + System.out.print(j + " "); + } + System.out.println(); + } + } +}