Pascal’s Triangle

Pascal’s Triangle

Pascal’s triangle represents the coefficents of terms in the binomial expansion of the (x+y)n

e.g.

ALGORITHM:

    1. Input no of rows
    2. [loop 1]for i=0 to n
      [loop 2]for j=0 to n-i-2
      PRINT a single space
      [end of loop2]
      [loop 3]for j = 0 to i
      SET c=fact(i)/(fact(j)*fact(i-j))
      PRINT value of c
      [end of loop 3]
      PRINT “n”
      [end of loop 1]

FACT(int n)


C SOURCE CODE:

Leave a Reply

Your email address will not be published. Required fields are marked *