C proğramlama dilinde * (asterick) simgesi ve döngülerle farklı desenler çıkarabiliriz.
Desen bir:
#include <stdio.h>
int main( void )
{
int line, space, asterick;
for ( line = 1; line <= 9; line += 2 )
{
for ( space = ( 9 - line ) / 2; space > 0; space-- )
printf( " " );
for ( asterick = 1; asterick <= line; asterick++ )
printf( "*" );
printf( "\n" );
}
for ( line = 7; line >= 0; line -= 2 )
{
for ( space = ( 9 - line ) / 2; space > 0; space-- )
printf( " " );
for ( asterick = 1; asterick <= line; asterick++ )
printf( "*" );
printf( "\n" );
}
return 0;
}
ÇIKTI =
*
**
***
****
*****
****
***
**
*
Desen iki:
#include<stdio.h>
int main(void)
{
int value1,value2;
for(value1=1;value1<=10;value1++)
{
for(value2=0;value2<value1;value2++)
printf("*");
printf("\n");
}
}
ÇIKTI=
*
**
***
****
*****
******
*******
********
*********
**********
Desen üç:
#include<stdio.h>
main()
{
int value1,value2;
for(value1=10;value1>=1;value1--)
{
for(value2=1;value2<=value1;value2++)
printf("*");
printf("\n");
}
return 0;
}
ÇIKTI=
**********
*********
********
*******
******
*****
****
***
**
*
Desen dört:
#include<stdio.h>
main()
{
int space,star,x;
for(x=1;x<=10;x++)
{
for(space=1;space<=10-x;space++)
printf(" ");
for(star=10;star>10-x;star--)
printf("*");
printf("\n");
}
return 0;
}
ÇIKTI=
*
**
***
****
*****
******
*******
********
********
C de Artistik(Baklava)
C de Artistik(Baklava)
Konuyu Okuyanlar: 1 Ziyaretçi
![[Resim: 114ld.jpg]](http://b1112.hizliresim.com/s/c/114ld.jpg)