WRITE A PROGRAM TO PRINT THE FOLLOWING STAR PATTERN
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int i, j, n;
cout<<"Enter number of rows\n";
cin>>n;
for(i=1;i<=n;i++)
{
for(j=1;j<=i;j++)
{
cout<<"*";
}
cout<<endl;
}
for(i=n-1;i>=1;i--)
{
for(j=1;j<=i;j++)
{
cout<<"*";
}
cout<<endl;
}
getch();
}
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int i, j, n;
cout<<"Enter number of rows\n";
cin>>n;
for(i=1;i<=n;i++)
{
for(j=1;j<=i;j++)
{
cout<<"*";
}
cout<<endl;
}
for(i=n-1;i>=1;i--)
{
for(j=1;j<=i;j++)
{
cout<<"*";
}
cout<<endl;
}
getch();
}