program segitiga c



kulo nuwun,
mau posting program c, yang segitiga, yaah walupun sederhana, tapi lumayan buat sarana pembelajaran juga ini koding nya..


#include

int main()
{
int i,j,tinggi ;

printf("masukkan tinggi segitiga: ");
scanf("%d",&tinggi);

for (i = 1; i <= tinggi; i++)
{
for (j= 1; j <=i; j++)
printf("*");
printf("\n"); /*pindah baris*/
}
return 0;
}

output nya

selamat mencoba ya teman teman



This entry was posted on Rabu, 23 Maret 2011. You can follow any responses to this entry through the RSS 2.0. You can leave a response.

Leave a Reply