Program Menampilkan Segitiga Sama Sisi Terbalik - Perulangan Do while / Looping C/C++
#include <stdio.h>
main (void)
{
int n, j, k, i;
printf ("Program membuat segitiga sama sisi terbalik\n");
printf ("Masukan kolom bintang = ");
scanf ("%d",&n);
i = 1;
do
{
j = 1;
do
{
printf (" ");
j++;
}
while (j <= i );
k = n;
do
{
printf ("* ");
k--;
}
while (k >= i);
printf ("\n");
i++;
}
while (i <= n);
}
Hasil running
0 Response to "Program Menampilkan Segitiga Sama Sisi Terbalik - Perulangan Do while / Looping C/C++"
Post a Comment