Back to problems

Print Pascal's Triangle (Symmetric Formatting)

Algorithm · Faire · Medium

Problem: Generate a Centered Pascal's Triangle Given an integer height, representing the number of rows in Pascal's Triangle with rows numbered from 1, produce and print the triangle using visually centered formatting. Definition of Pascal's Triangle The first row contains 1. Row i contains exactly i values. Every row begins and ends with 1. Each interior value is computed as triangle[i][j] = triangle[i-1][j-1] + triangle[i-1][j], using the 1-indexed description. Symmetric…

Checking your access…