Problems:   Write a C program to print Patterns Inverted Pyramid
        *****
      ****
    ***
   **
 *
Source Code:
  1. #include <stdio.h>

  2. int main()
  3. {
  4.     int i, j, n;

  5.     printf("Enter N: ");
  6.     scanf("%d", &n);
  7.     for (i=n;i>=1;i--)
  8.      {
  9.      
  10.         for(j=1;j<=i;j++)
  11.           {
  12.           printf("*");
  13.           }
  14.            printf("\n");
  15.      }
  16.     
  17.     
  18.      return 0;
  19.  }


Output:


0 comments:

Post a Comment