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