How do I print a reverse Floyd's Triangle (counting down)?
Calculate the total number of elements mathematically (N * (N + 1) / 2), initialize the external variable to that maximum number, and decrement it on every print.
Verify This Answer
Cross-check this information using these trusted sources:
More FAQs in Floyd's Triangle: Printing Sequential Numbers
Floyd's Triangle is a right-angled triangular array of natural numbers, where the numbers increment continuously without resetting on new rows.
Because loop variables naturally reset. The column resets to 1 on every new row, but Floyd's Triangle requires a continuous, non-resetting count.
Declare an accumulator or counter variable outside and above the outer loop, and increment it inside the innermost loop.
Still have questions?
Browse all our FAQs or reach out to our support team
