14 May 2024 Shift 2 — Pattern: Right-Angle Triangle of Numbers

E · easyP · Verified PYQpattern-printing

Print a right-angled triangle pattern of numbers for N rows: Row 1: 1 Row 2: 1 2 Row 3: 1 2 3 … Row N: 1 2 3 … N

Input
4
Output
1
1 2
1 2 3
1 2 3 4
Outer loop i from 1 to N. Inner loop j from 1 to i. Print j with space, newline after inner loop.
← 14 May 2024 Shift 1 — Fibonacci Series26 April 2024 — All Subarrays with Sum Equal to K →
Report an issue with this question