how to find the ith 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:
- command line coursera
- initialize array in c with 0
- animation with c
- c float to int
- PATH_MAX
- code in c skipping over scanf
- entity framework core discard changes
- cloudflare dns
- convert list of strings to string
- c memcpy array
- root in C
- cmd command to hide folder
- binary search time complexity
- imprimir matriz
- mariadb unknown collation: 'utf8mb4_0900_ai_ci'
- c get first n characters of string
- c interview questions for experienced
- c return
- check if audio is muted python
- how to add a comment in c
- c hello world
- C typedef
- how to find the ith row of pascal's triangle in c
- how to transfer textbox fro string to integer vb.net