C Program to Print Full Pyramid


In this program we will print full pyramid using *

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

Output

Output!