Program Bintang Segitiga Siku Siku

Gambar Program Bintang Segitiga
#include <stdio.h>
int main(){
int a,b,n;

printf ("Masukkan Tinggi Segitiga: ");scanf("%d",&n);

for (a=0;a<=n;a++)
{
for (b=1;b<=a;b++){
printf("*");
}
printf("\n");
}
}

2. Program Bintang Segitiga Siku Siku Terbalik

Gambar Program Bintang Segitiga
#include <stdio.h>
         int main(){
int a,b,n;

printf ("Masukkan Tinggi Segitiga: ");scanf("%d",&n);

for (a=0;a<=n;a++)
{
for (b=a;b<=n;b++){
printf("*");
}
printf("\n");
}
}

3. Program Bintang Segitiga Sama Kaki

Gambar Program Bintang Segitiga
#include <stdio.h>
int main(){
int a,b,n;

printf ("Masukkan Tinggi Segitiga: ");scanf("%d",&n);

for (a=0;a<=n;a++)
{
for (b=a;b<=n;b++){
printf(" ");
}
for (b=1;b<=a;b++){
printf("*");
}
for (b=1;b<a;b++){
printf("*");
}
printf("\n");
}
}

4. Program Bintang Segitiga Sama Kaki Terbalik

Gambar Program Bintang Segitiga
#include <stdio.h>
int main(){
int a,b,n;

printf ("Masukkan Tinggi Segitiga: ");scanf("%d",&n);

for (a=0;a<n;a++)
{
for (b=0;b<a;b++){
printf(" ");
}
for (b=a;b<n;b++){
printf("*");
}
for (b=a;b<n-1;b++){
printf("*");
}
printf("\n");
}
}

5. Program Bintang Jajar Genjang

Gambar Program Bintang Segitiga
#include <stdio.h>
int main(){
int a,b,n;

printf ("Masukkan Tinggi Jajar Genjang: ");scanf("%d",&n);

for (a=1;a<=n;a++)
{
for (b=1;b<=a;b++){
printf(" ");
}
for (b=1;b<=a;b++){
printf("*");
}
for (b=a;b<n;b++){
printf("*");
}
printf("\n");
}
}

6. Program Bintang Jajar Genjang Terbalik

Gambar Program Bintang Segitiga
#include <stdio.h>
int main(){
int a,b,n;

printf ("Masukkan Tinggi Jajar Genjang: ");scanf("%d",&n);

for (a=1;a<=n;a++)
{
for (b=a;b<=n;b++){
printf(" ");
}
for (b=1;b<=a;b++){
printf("*");
}
for (b=a;b<n;b++){
printf("*");
}
printf("\n");
}
}

7. Program Bintang Belah Ketupan

Gambar Program Bintang Segitiga

#include <stdio.h>
int main(){
int a,b,n;

printf ("Masukkan Tinggi Belah Ketupat: ");scanf("%d",&n);

for (a=1;a<=n;a++)
{
for (b=a;b<=n;b++){
printf(" ");
}
for (b=1;b<=a;b++){
printf("*");
}
for (b=1;b<a;b++){
printf("*");
}
printf("\n");
}
for (a=1;a<n;a++)
{
for (b=0;b<=a;b++){
printf(" ");
}
for (b=a;b<n;b++){
printf("*");
}
for (b=a;b<n-1;b++){
printf("*");
}
printf("\n");
}
}