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!
download android app

Popular C Examples









codesadda.com

Codesadda.com is your home of programming solutions, tutorials, video tutorials and much more. Sign Up for our weekly newsletter to get update about new content.

Like us on Facebook | Connect with us on LinkedIn | Subscribe our Channel on Youtube