using System;
public class Program
{
public static void Main()
printPascalTriangle(5);
}
//add the two numbers in the row above and to the left of that.
public static void printPascalTriangle(int size){
int[,] myTwoDimArray = {{0,0,0,0,0,0},{0,0,0,0,0,0},{0,0,0,0,0,0},{0,0,0,0,0,0},{0,0,0,0,0,0},{0,0,0,0,0,0}};
int distance = 0;
//hard code the first and last columns to one
for (int row = 0;row < myTwoDimArray.Rank;row++){
if (row ==0){
myTwoDimArray[0,0] = 1;
distance++;
}else{
myTwoDimArray[row,0] = 1;
myTwoDimArray[row,distance] = 1;
Console.WriteLine("myTwoDimArray.Rank" + myTwoDimArray.Rank);
//loop through the array and do the math
//find both numbers to add for this specific value
for (int col = 0;col < myTwoDimArray.GetLength(row);col++){
if(col > 1 && row > 1){//catch where the array might go out of range.
int sum = myTwoDimArray[row - 1,col] + myTwoDimArray[row - 1,col - 1];
myTwoDimArray[row,col] = sum;
//Console.WriteLine(myTwoDimArray[col,row]);
//print the array
int value = myTwoDimArray[row,col];
if(value > 0){//only print the values greater than zero
Console.Write(value);
Console.WriteLine("");