Listing Program :
# include
#include
void main()
{
int x,y,z,a=1;
for ( x=1;x<=3;x++)
{
for ( z=2;z>= x;z--)
cout<<" ";
for ( y=1;y<=x;y++)
{cout< a++;}
cout< }
for ( x=1;x<=2;x++)
{
for ( z=1;z<=x;z++)
cout<<" ";
for ( y=2;y>=x;y--)
{cout< a++;}
cout< }
}
Tidak ada komentar:
Posting Komentar