& & & & &
& & &
&
#include <iostream.h>
#include <conio.h>
void main()
{
int n;
clrscr();
cout<<"\n Enter height of a triangle :";
cin>>n;
for(int i = n, sp = 0; i >0 ; i --, sp++)
{
for(int k=0; k<=sp; k++)
cout<<" "<<" ";
for( int j = 1; j < 2*i ; j++)
{
cout << "&" << " ";
}
cout<<"\n";
}
getch();
}
No comments:
Post a Comment