The rectangle star pattern problem is similar to the square star pattern problem. Click here to view square star pattern problem
Example
Input:
Enter number of rows: 5 Enter number of columns: 3
Output:
*** *** *** *** ***
Required Knowledge
Basic C++ programming, For loop, Nested loop
Program
#include <iostream>using namespace std; /* * Siddharth Goyal * Chandigarh Engineering College, Landran * */ int main() { int i, j, rows, columns; cout<<"Enter number of rows: "; cin>>rows; cout<<"Enter number of columns: "; cin>>columns; for(i=1; i<=rows; i++) { for(j=1; j<=columns; j++) { cout<<"*"; } cout<<"\n"; } return 0; }