fork download
  1. #include <stdio.h>
  2.  
  3.  
  4.  
  5.  
  6. int main() {
  7. int n;
  8. printf("Enter the n: \n");
  9. scanf("%d",&n);
  10.  
  11.  
  12.  
  13. for( int i=0;i<=n;i++){
  14.  
  15. for(int sp=1;sp<=n-i;sp++){
  16. printf(" ");
  17. }
  18.  
  19. int first =1;
  20.  
  21. for(int j=0;j<=i;j++){
  22. printf(" %d ",first);
  23. int first= first*i-j/(j+1);
  24.  
  25. }
  26. printf("\n");
  27. }
  28.  
  29. return 0;
  30. }
Success #stdin #stdout 0s 5292KB
stdin
6
stdout
Enter the n: 
                    1  
                 1    1  
              1    1    1  
           1    1    1    1  
        1    1    1    1    1  
     1    1    1    1    1    1  
  1    1    1    1    1    1    1