C Program to Print Inverted Half Pyramid Using '*'



In this program we will print inverted half pyramid using *



  1. //C program to print inverted half pyramid using '*'
  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=rows; i>=1; --i)
  9. {
  10. for(j=1; j<=i; ++j)
  11. {
  12. printf("* ");
  13. }
  14. printf("\n");
  15. }
  16. return 0;
  17. }

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