Program Menampilkan Segitiga Sama Sisi - Perulangan For / Looping C/C++
Praktikum Perulangan For / Loop C/C++
Hasil running
#include <stdio.h> int main () { int n, i, j, s; printf ("Program membuat segitiga sama sisi\n"); printf ("Masukan jumlah baris bintang = "); scanf ("%d",&n); for (i = 1; i <= n; i++) { for (j = n; j >= i; j--) printf (" "); for (s = 1; s <= i; s++) printf ("* "); printf ("\n"); } return 0; }
Hasil running
0 Response to "Program Menampilkan Segitiga Sama Sisi - Perulangan For / Looping C/C++"
Post a Comment