fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. int n = 5;
  5. for (int i = 1; i <= n; i++) {
  6. /* Centering whitespace offset */
  7. for (int s = 1; s <= n- i; s++) {
  8. printf(" ");
  9. }
  10. /* Odd progression of asterisks: (2*i-1) */
  11. for (int j = 1; j <= (2 * i- 1); j++) {
  12. printf("*");
  13. }
  14. printf("\n");
  15. }
  16. return 0;
  17. }
Success #stdin #stdout 0s 5312KB
stdin
Standard input is empty
stdout
    *
   ***
  *****
 *******
*********