Pattern 37: Number pattern program in C 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
 1 1 1 1 1
 2 2 2 2
 3 3 3
 4 4
 5
Note: This program is one of the Series of Number pattern programs in C.

Program to print number pattern:

  1. /*
  2.    C Program to 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=i;j<=n;j++)
  14.          printf(” %d”,i);
  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. 11213141 says:

    I want the program
    11111111
    0000000
    *********
    11111111
    000000

Leave a Reply