Posts

Showing posts from October, 2016

Program to Print Pascal Triangle

Image
This is a C++ P rogram to print Pascal triangle which you might have studied in Binomial Theorem in Mathematics. Number of rows of Pascal triangle to print is entered by the user. So, the code would be like this:

Program to Find nCr and nPr (Combinations and Permutations)

Image
This is a C++ language program code to find nCr (Combinations) and nPr (Permutations). Note that the program uses following formulas to find nCr and nPr. The permutations formula is (P(n,r) = n! / (n - r)!). The combinations formula is (C(n,r) = n! / r! * (n - r)!). Here we go! :D