Skip to content

dovito/pascal_triangle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 

Repository files navigation

A program that formats and prints Pascal's triangle by the given number of rows in the desired triangle

Background

Pascal's triangle is a triangular array of the binomial coefficients where each number is the sum of the two directly above it. See Wikipedia for more info

Compile:

g++ pascalTriangle.cpp -o pascalTriangle

To run:

In Windows type: pascalTriangle.exe
In Unix based OS type: ./pascalTriangle

Example:

$: ./pascalTriangle
This is a program that draws a Pascal's Trinagle.
Enter the number of rows to be displayed> 5
You have entered 5. Proceed? (type 'y'-yes, 'n'-no, 'r'-reset): y
         1
      1   1
    1   2   1
  1   3   3   1
1   4   6   4   1

About

A program that displays Pascal's triangle by the given number of desired number of rows

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages