fork download
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5. // your code goes here
  6.  
  7. int n=8;
  8.  
  9. for(int i=1; i<=n; i++)
  10. {
  11. for(int j=0; j<n-i; j++) printf(" ");
  12.  
  13. for(int j=0; j<i-1; j++) printf("%i * ", i);
  14.  
  15. printf("%i \n", i);
  16.  
  17. }
  18.  
  19. return 0;
  20. }
  21.  
Success #stdin #stdout 0s 9424KB
stdin
Standard input is empty
stdout
              1 
            2 * 2 
          3 * 3 * 3 
        4 * 4 * 4 * 4 
      5 * 5 * 5 * 5 * 5 
    6 * 6 * 6 * 6 * 6 * 6 
  7 * 7 * 7 * 7 * 7 * 7 * 7 
8 * 8 * 8 * 8 * 8 * 8 * 8 * 8