membuat bentuk segitiga menggunakan bintang

29 Januari, 2009

=========================================
*membuat bentuk segitiga menggunakan bintang
=========================================
#include
int main()
{
int x,y;

for (x=1;x<=5;x++)
{for (y=1;y<=x;y++)
{
printf("*");
}
printf("\n") ;
}
for (x=1;x<=5;x++)
{for (y=x;y<=4;y++)
{
printf("*");
}
printf("\n") ;
}

return 0;
}

output:
*
**
***
**
*

Related Post:

0 komentar:

About This Blog

Lorem Ipsum

  © Free Blogger Templates Columnus by Ourblogtemplates.com 2008 and Modified by blog wallpaper

Back to TOP