Menggambar Grafik Dengan Bahasa C Part 1

Posted on Updated on



/*indeks perulangan menurun*/

#include<stdio.h>
#include<conio.h>
main()
{
 int i,j,tinggi;

printf("bentuk Segitiga siku \n");
 printf("masukkan tinggi= ");scanf("%d",&tinggi);
 for (i=1;i<=tinggi;i++)
 { for (j=1;j<=i;j++)
 { printf ("x");
 } printf ("\n");
 } getche();clrscr();
}

bintang1


/*indeks perulangan menurun*/
#include<stdio.h>
#include<conio.h>
main()
{
 int x,y,tinggi;
 printf("masukkan tinggi= ");scanf("%d",&tinggi);;
 for (x=1;x<=tinggi;x++)
 { for (y=x;y<=tinggi;y++)
 { printf ("x");
 } printf ("\n");
 } getche();clrscr();
}

bintang1balik

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s