-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3f93ade
commit 00959c4
Showing
1 changed file
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#include<iostream> | ||
using namespace std; | ||
int main() | ||
{ | ||
int a=10; | ||
int b=10; | ||
for(int i=1;i<=a;i++) | ||
{ | ||
for(int j=1;j<=b;j++) | ||
{ | ||
if (i==5 || j==5) | ||
{ | ||
cout<<"*"; | ||
} | ||
else | ||
{ | ||
cout<<" "; | ||
} | ||
} | ||
cout<<endl; | ||
} | ||
cout<<endl; | ||
cout<<"take input from the user and print the rectangle:"<<endl; | ||
cout<<endl; | ||
int x; | ||
int y; | ||
cout<<"Enter Number for the row:"<<endl; | ||
cin>>x; | ||
cout<<"Enter the Number for the coloum:"<<endl; | ||
cin>>y; | ||
|
||
for(int i=1;i<=x;i++) //this's for the rows. | ||
{ | ||
for(int j=1;j<=y;j++) //this is for the coloum. | ||
{ | ||
cout<<"*"; | ||
} | ||
cout<<endl; | ||
} | ||
} |