Creating Pascal's Triangle in C#: for computer science at GCSE, IGCE, A Level and programmers

Creating Pascal's Triangle in C#
Creation of Pascal's Triangle in C#

The above animation is produced in C# programming language for students who do computer science at GCSE, IGCSE, IB and A Level.

The code snippet consists of four major function that collectively produce the Pascal's Triangle.

They are:

  1. A factorial function
  2. A function to generate combinations
  3. A function to generate Pascal's Triangle in the correct format
  4. The main function to run the function in step 3).
The code snippet is given below; you can practise it interactively by providing the function, Pascal's Triangle(n), the parameter required - the number of rows.

Since the formatting is programmed up to 10 rows, please use a number below 10.


Popular posts from this blog

Phase Difference between Two Points on a Wave and Path Difference Explained - interactive

Frequency Amplitude and Wavelength of a Transverse Wave - simulation