hbhjh

  1. #include <stdio.h>
  2. int main()
  3. {
  4. int i, space, rows, k=0;
  5. printf("Enter number of rows: ");
  6. scanf("%d",&rows);
  7. for(i=1; i<=rows; ++i, k=0)
  8. {
  9. for(space=1; space<=rows-i; ++space)
  10. {
  11. printf(" ");
  12. }
  13. while(k != 2*i-1)
  14. {
  15. printf("* ");
  16. ++k;
  17. }
  18. printf("\n");
  19. }
  20. return 0;
  21. }

Comments