C Program to Print Rectangle Star Pattern

In this tutorial you will learn about the C Program to Print Rectangle Star Pattern and its application with practical example.

C Program To Print Rectangle Star Pattern

In this tutorial, we will learn to create a C program that will Print Rectangle Star Pattern in C programming.

Prerequisites

Before starting with this tutorial, we assume that you are the best aware of the following C programming topics:

  • Operators in C Programming.
  • Basic Input and Output function in C Programming.
  • Basic C programming.
  • For loop in C Programming.
  • Arithmetic operations in C programming.

What is a rectangle?

The rectangle is four sides geometrical shape with pair of two sides parallel and of the same size as each other. The Rectangle has the length and the width in it.

Algorithm:-

Program description:-

In this tutorial, we will create a program, that will print the Rectangle pattern. we will First, take the rows and the columns of the Rectangle from the user. Then we will print the rectangle pattern using the nested for loops.

Program Code:-

Output:-

In the above program, we have first initialized the required variable.

  •  rw = it will hold the input value for the rows of the Rectangle.
  •  clm = it will hold the input value for the columns of the Rectangle.
  •  i, j = it will hold the value for controlling the loop.

Taking the input rows and the columns of the Rectangle.

Generating the pattern using the for loop to print the Rectangle.

Printing the pattern of the Rectangle.

In this tutorial we have learn about the C Program to Print Rectangle Star Pattern and its application with practical example. I hope you will like this tutorial.