Star Pattern

#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int n;
cout<<” enter the value”;
cin>>n;
int m=10;
int s=n-1;
for(int i=1;i<=n;i++)
{
for(int j=2*n-3;j>=s;j–)
{
cout<<” “;
}
for(int p=10;p>=m;p=p-1)
{
cout<<“*”;
}
cout<<“\n”;
m=m-2;
s++;
}
int y=n-1;
int v=2*n-2;
for(int q=n;q>=1;q–)
{
for(int g=n-1;g>=y;g–)
{
cout<<” “;
}
for(int h=1;h<v;h=h+1)
{
cout<<“*”;
}
cout<<“\n”;
y–;
v=v-2;
}
getch();
}

Calendar

June 2024
M T W T F S S
 12
3456789
10111213141516
17181920212223
24252627282930

Categories

Archives