Print specific row in Pascal’s triangle + Print All Rows

These are part of my programming notes. I doubt you’ll find anything useful. I upload stuff here because I prefer Medium’s UI to Github’s.

Formula: CurrentValue = (PreviousValue *(level — rowIndex + 1))/rowIndex

/*
*Name: GenerateSpecificRowPascalTriangle
*Role: Find binomial coefficents in a single row of Pascal's Triangle
*Input: long level - this is the row number(Long is for 64-bit math)
*Sample input: GenerateSpecificRowPascalTriangle(8)
*Sample output: 1 8 28 56 70 56 28 8 1
*/
void GenerateSpecificRowPascalTriangle(long level)
{
long previousValue = 1;
printf("%ld", previousValue);

for(int rowIndex = 1; rowIndex <= level; rowIndex++)
{
long currentValue = (previousValue * (level - rowIndex + 1)) / rowIndex;
printf("\t%ld", currentValue);
previousValue = currentValue;
}
}