Pattern 27: C program to print below pyramid Number Pattern using for loops

Spread the love

Write a C Program to print below number pattern on the console:

Enter how many rows you want : 5
 5 4 3 2 1
 4 3 2 1
 3 2 1
 2 1
 1

Note: This program is one of the Series of Number pattern programs in C.

Program:

  1. /*
  2.   C Program to print Number Pattern
  3.   WebSite : www.SillyCodes.com
  4. */
  5. #include<stdio.h>
  6. int main()
  7. {
  8.    int i,j,k,n;
  9.    printf(“Enter how many rows you want : “);
  10.    scanf(“%d”,&n);
  11.    for(i=n;i>0;i)
  12.    {
  13.       for(j=i;j>0;j)
  14.          printf(” %d”,j);
  15.       printf(n);
  16.    }
  17.    return 0;
  18. }

Output:

Similar Number Patterns:

Similar Star pattern programs :

Venkatesh Macha

Hi Guys, I am Venkatesh Macha. I am a programmer and an Open Source enthusiast, Presently working as a Software Engineer. Apart from that, I love to explore new technologies and things.

You may also like...

1 Response

  1. Eniya Elango says:

    Write a program to print the given pattern.

    Input Format:
    Input consists of a single integer.

    Output Format:
    Refer sample outputs. There is a trailing space at the end of each line.

    Sample Input:
    5

    Sample Output:
    1 2 3 4 5
    2 3 4 5
    3 4 5
    4 5
    5

Leave a Reply