public void PrintPascalTriangle(int inNumberOfLines)
{
int noOfLines = inNumberOfLines;
int number = 1;
for(int i=0;i<noOfLines;i++)
{
number = 1;
for(int j=0;j<=i;j++)
{
Console.Write(number + " ");
number = number * (i - j) / (j + 1);
}
}
}
how can convert this method into single loop and print values in single row?
I just need Pascal triangle values in a row (no need to worry about spaces or visual rep) upto n.