Skip to content

Commit

Permalink
Star pattrens
Browse files Browse the repository at this point in the history
  • Loading branch information
Warishayat committed Jan 24, 2024
1 parent 3f93ade commit 00959c4
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions day7.cpp
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;
}
}

0 comments on commit 00959c4

Please sign in to comment.