pattern 25: C program to print 12345 number pattern using for loops

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

Enter how many rows you want : 5
 1 2 3 4 5
 1 2 3 4
 1 2 3
 1 2
 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.         Author : Venkatesh Macha.
  4.         WebSite : www.SillyCodes.com
  5. */
  6. #include<stdio.h>
  7. int main()
  8. {
  9.    int i,j,k,n;
  10.    printf(“Enter how many rows you want : “);
  11.    scanf(“%d”,&n);
  12.  
  13.    for(i=n;i>0;i)
  14.    {
  15.       for(j=1;j<=i;j++)
  16.          printf(” %d”,j);
  17.  
  18.       printf(n);
  19.    }
  20.    return 0;
  21. }

Output : 

Similar Number Patterns:

Similar Star pattern programs :

Venkatesh Macha

Hi Guys, I am Venkatesh Macha. Founder of SillyCodes. I am a programmer, Presently working as a Software Engineer in Hyderabad. I love Linux and Open Source. Apart from that, I love to explore new technologies and things.

You may also like...

6 Responses

  1. int main()
    {
    int i,j,k,n;
    printf("Enter how many rows you want : ");
    scanf("%d",&n);

    for(i=1;i<=n;i++)
    {
    for(j=1;j<=i;j++)
    printf(" %d",i);

    printf("n");
    }
    return 0;
    }

    Read more: http://www.sillycodes.com/2015/11/write-c-program-to-print-below-number-using-loops.html

  2. int main()
    {
    int i,j,k,n;
    printf("Enter how many rows you want : ");
    scanf("%d",&n);

    for(i=n;i>0;i–)
    {
    for(j=i;j<=n;j++)
    printf(" %d",j);

    printf("n");
    }
    return 0;
    }

    Read more: http://www.sillycodes.com/2015/11/pattern-31-c-program-to-print-below.html

  3. #include
    int main()
    {
    int i,j,k,n;
    printf("Enter how many rows you want : ");
    scanf("%d",&n);

    for(i=1;i<=n;i++)
    {
    for(j=1;j<=i;j++)
    printf(" %d",j);

    printf("n");
    }
    return 0;
    }

    Read more: http://www.sillycodes.com/2015/10/pattern-24-c-program-to-print-triangle-number-pattern.html

  4. Eniya Elango says:

    Pattern 7
    Write a program to print the given pattern.

    Input Format:
    Input consists of a single integer.

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

    Sample Input:
    5

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

  5. Eniya Elango says:

    Pattern 6
    Write a program to print the given pattern.

    Input Format:
    Input consists of a single integer.

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

    Sample Input:
    5

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

  6. 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
    1 2
    1 2 3
    1 2 3 4
    1 2 3 4 5

Leave a Reply

Your email address will not be published. Required fields are marked *