Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main()
- {
- int x[10][10];
- int i,j;
- for (i=0; i<10; i++)
- {
- for (j=0; j<=10; j++)
- {
- if ((j==0) || (i==j))
- {
- x[i][j] = 1;
- }
- else
- {
- x[i][j] = x[i-1][j] + x[i-1][j-1];
- }
- }
- }
- for(i=0;i<=9;i++)
- {
- for(j=0;j<=9;j++)
- {
- if (x[i][j] != 0)
- {
- printf("%d ", x[i][j]);
- }
- }
- printf("\n");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement