Advertisement
Guest User

DIMA SUDA

a guest
Feb 26th, 2020
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <math.h>
  3. #include <stdlib.h>
  4. #define n 8
  5. void main()
  6. {
  7. int i, j, a[n][n];
  8. for (i = 0; i < n; i++)
  9. {
  10. for (j = 0; j <= i; j++)
  11. {
  12. if ((j == 0) || (j == i))
  13. a[i][j] = 1;
  14. else a[i][j] = a[i - 1][j - 1] + a[i - 1][j];
  15. printf("%d\t", a[i][j]);
  16. }
  17. printf("\n");
  18. }
  19. system("pause");
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement