Pattern 27: C program to print below pyramid Number Pattern

Number Pattern 3:

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
 
At each row we are removing the first number of previous row.

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

Number Pattern Program:

Venkatesh

Hi Guys, I am Venkatesh. I am a programmer and an Open Source enthusiast. I write about programming and technology on this blog.

You may also like...

2 Responses

  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

    • Irish Sami says:

      #include
      #include

      int main()
      {
      int j, num;
      printf(“Enter a Number: “);
      scanf(“%d”, &num);
      printf(“\n”);

      j = 1;
      for(int k = 1; k <= num; k++)
      {
      for( ; j <= num; j++)
      printf("%d ", j);
      j = k + 1;
      printf("\n");
      }
      return 0;
      }

      OUTPUT:..

      Enter a Number: 5
      1 2 3 4 5
      2 3 4 5
      3 4 5
      4 5
      5

Leave a Reply