Program to print a rectangle of * in C++ programming language

 Program to print a rectangle of * in C++ programming language:

#include<iostream>
using namespace std;
int main()
{
int height,length;
cout<<"enter the lenghth ";
cin>>length;
cout<<"\nenter the height ";
cin>>height;
for(int i=0;i<=length;i++)
{
for(int j=0;j<=height;j++)
{
cout<<"*";
}
cout<<endl;
}
return 0;
}

output:
enter the length 10

enter the height 10
***********
***********
***********
***********
***********
***********
***********
***********
***********
***********
***********

Comments