C Program to Print Half Pyramid

In this program we will print half pyramid using *

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

Please click on the like button if it worked

Solution not working or have any suggestions? Please send an email to [email protected]

Join Our Facebook Group

Share this example

Download Android App

download android app

Popular C Examples


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