Featured
- Get link
- X
- Other Apps
C++ program to print the following pattern of hollow triangle
/*program to print the following pattern of hollow triangle
&
& &
& &
& &
& &
&&&&&&&&&&
*/
#include<iostream.h>
#include<conio.h>
void main(void)
{
clrscr();
int i,j,k,l,spo=5,spi=-1;
for(i=1;i<=6;i++,spo--,spi+=2)
{
for(l=1;l<=spo;l++)
{cout<<" ";}
cout<<"&";
for(l=1;l<=spi;l++)
{cout<<" ";}
if(i==2||i==3||i==4||i==5)
cout<<"&";
if(i==6)
{cout<<"\r";
for(l=1;l<=11;l++)
cout<<"&";
}
cout<<"\n";
}
getch();
}
- Get link
- X
- Other Apps
Popular Posts
C++ program to display numbers which get reversed after multiplying by 4
- Get link
- X
- Other Apps
Comments
Post a Comment