Program Menampilkan Segitiga Siku-Siku Rata Kanan - Perulangan For / Looping C/C++
#include <stdio.h> #include <conio.h> int main () { int n, i, j, s; printf ("Program membuat segitiga siku-siku rata kanan\n"); printf ("Masukan jumlah baris bintang = "); scanf ("%d",&n); for (i = 1; i <= n; i++) { s = n - i; for (j = 1; j <= s; j++) printf (" "); for (j = 1; j <= i; j++) printf ("*"); printf ("\n"); } getch (); printf ("Benerkan ... Bintangnya jadi Rata kanan...\n"); getch (); printf ("S E L E S A I"); return 0; }
Hasil running
0 Response to "Program Menampilkan Segitiga Siku-Siku Rata Kanan - Perulangan For / Looping C/C++"
Post a Comment