how to find the nth row of pascal's triangle in c
#include <stdio.h>
#include <stdlib.h>
int main()
{
int N;
scanf("%d", &N);
int pascalArray[N + 1][N + 1];
int i, j;
if(0 <= N && N <= 20)
{
for (i = 0; i < N + 1; i++)
{
for(j = 0; j <= i; j++)
{
if(j == 0 || j == i)
pascalArray[i][j] = 1;
else
pascalArray[i][j] = pascalArray[i-1][j-1] + pascalArray[i-1][j];
if (i == N)
printf("%d ", pascalArray[i][j]);
}
}
}
return 0;
}
Also in C:
- strcat in c
- import a library in c
- how to find the nth row of pascal's triangle in c
- counter program in c language
- c flip variable
- for statement in c
- c find last element in array
- bella ciao lyrics
- lazer codechef
- pointer basics
- types of bastion minecraft
- stack
- c null define
- putting value of struct in runtme
- #pragma pack(1) in c
- c print long
- how to zoom in terminal
- arduino client.read
- c \b
- peripheral bus clock pic32
- invalid operands to binary expression ('int *' and 'int *')
- multiplicacion recursiva
- linux kernel write()
- c concatenate strings