C program to print rectangle pattern of numbers || Reverse Numbers (Type 2) || Patterns || for loop || C Programming
This is a for loop program in which we will print a very simple pattern of numbers in reverse, with the help of the C Programming language.



#include <stdio.h>
void main()
{
    int rows;
    printf( "\nEnter the number of rows\n");
    scanf("%d",&rows);
    printf("\n");

    for (int i = 1; i <= rows; i++)
    {
        for (int j = rows; j >= 1; j--)
        {
            printf("%d ", j);
        }
        printf("\n");
    }
}

#ENJOY CODING

2 Comments

FOR ANY DOUBTS AND ERRORS FEEL FREE TO ASK. YOUR DOUBTS WILL BE ADDRESSED ASAP

  1. Hi i want to ask looping code for output below
    3 5 7 9
    6 8 10 12
    9 11 13 15
    12 14 16 18
    15 17 19 21

    ReplyDelete
    Replies
    1. #include
      int main()
      {
      int i, j, k, x;

      x = 3;

      for (i = 3; i <= 15; i++)
      {
      if (i % 2 == 0)
      k = i + 2;
      else
      k = i;
      for (j = 1; j <= 4; j++)
      {
      printf(" %d", k);
      k += 2;
      x = k;
      }
      printf("\n");
      }
      return 0;
      }


      The above given code nearly satisfies your required Query.

      Delete

Post a Comment

FOR ANY DOUBTS AND ERRORS FEEL FREE TO ASK. YOUR DOUBTS WILL BE ADDRESSED ASAP

Previous Post Next Post