*
* *
* *
* *
* *
* * * * * * * * * * *
#include <iostream.h>
#include <conio.h>
void main()
{
int n;
cout<<"\n Enter height :";
cin>>n;
for(int r = 1, sp = n-1 ; r<= n ; r++, sp--)
{
for (int k = 0; k<=sp ; k++)
cout<< " " ;
for(int c = 1; c < 2*r ; c++)
{
if(c==1 || c == 2*r - 1 || r == n )
cout << "&";
else
cout<< " " ;
}
cout<< endl;
}
getch();
}
No comments:
Post a Comment