fork(2) download
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <string.h>
  4.  
  5. int main(void) {
  6. int i, visina = 9;
  7. char *str = malloc(visina + 1);
  8. memset(str, '*', visina);
  9. str[visina] = '\0';
  10.  
  11. for(i=1;i<2*visina;i++)
  12. {
  13. printf("%.*s\n", (visina-abs(visina-i)), str);
  14. }
  15. return 0;
  16. }
Success #stdin #stdout 0s 2424KB
stdin
Standard input is empty
stdout
*
**
***
****
*****
******
*******
********
*********
********
*******
******
*****
****
***
**
*