Simple Rectangle Shape in C++

Code:

//simple box
#include<iostream>
using namespace std;
int main()
{
	int i,j,k,l;
	cout<<"enter number of rows"<<endl;
	cin>>j;
	cout<<"enter number of coloumns"<<endl;
	cin>>k;

	for(i=1;i<=j;i++)
	{
		for(l=1;l<=k;l++)
		cout<<"*";
		cout<<"\n";
	}

	return 0;
}

Output:

enter number of rows
6
enter number of coloumns
8
********
********
********
********
********
********

Related Post

Leave a Reply

Your email address will not be published. Required fields are marked *