Pattern 28: C Program to print 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
 5 4 3 2
 5 4 3
 5 4
 5

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

Program :

  1. /*
  2.  C Program print number pattern on Console
  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=1;i<=n;i++)
  12.    {
  13.       for(j=n;j>=i;j)
  14.          printf(” %d”,j);
  15.       printf(n);
  16.    }
  17.    return 0;
  18. }

Output:

Similar Number Patterns:

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...

Leave a Reply