Advertisement
Guest User

Untitled

a guest
May 29th, 2016
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5. int x[10][10];
  6. int i,j;
  7.  
  8. for (i=0; i<10; i++)
  9. {
  10. for (j=0; j<=10; j++)
  11. {
  12. if ((j==0) || (i==j))
  13. {
  14. x[i][j] = 1;
  15. }
  16. else
  17. {
  18. x[i][j] = x[i-1][j] + x[i-1][j-1];
  19. }
  20. }
  21. }
  22.  
  23. for(i=0;i<=9;i++)
  24. {
  25. for(j=0;j<=9;j++)
  26. {
  27. if (x[i][j] != 0)
  28. {
  29. printf("%d ", x[i][j]);
  30. }
  31. }
  32. printf("\n");
  33. }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement