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