Grafik dengan Bahasa C Part 2

Posted on Updated on



/*2 Segitiga*/
#include<stdio.h>
#include<conio.h>
main()
{
 int tinggi;
 int i,j,x,y;
 printf("masukkan tinggi= ");scanf("%i",&tinggi);
 printf("\n");

for (i=1;i<=tinggi;i++)
 { for (j=1;j<=i;j++)
 { printf ("x");
 } printf ("\n");
 }
for (x=1;x<=tinggi;x++)
 { for (y=x;y<=tinggi;y++)
 { printf ("x");
 } printf ("\n");
 }

 getche();clrscr();
}


biintanggabung kiri

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