Example
Input
Input number of rows: 5
Output
*****
*****
*****
*****
*****
Knowledge Required
- Nested Loops
- conditional Statements
Program to print square star pattern
#include <iostream>* using namespace std; /** Engineer Siddharth Goyal * Chandigarh Engineering College, Landran * */ int main(){ int i, j, N; cout<<"Enter number of rows: "; cin>>N; for(i=1; i<=N; i++){ for(j=1; j<=N; j++){ cout<<"*"; } cout<<"\n"; } return 0; }
