C++

PASCALSTRIANGLE

Submitted by ashine80 on
This will print the Pascals Triangle up to 'n' lines. I created the Matrix of nXn Matrix. Then initilized all the element to zero. Then Calculated the Combination of i,j using the formula: C(n,r)=n!/(r!*(n-r)!) Before that I calculated the Factorial of a number by using a recursive Function.

Collinear Points

Submitted by ashine80 on
This program will print whether the three points of Cartesian Coordinate System (x,y) is collinear or not. I formed a 3x3 matrix and then calculated the determinant. If determinant is zero these three points are collinear otherwise not.