1. Anasayfa
  2. Programlama Temelleri

C# Console For Döngüsü Yıldız Yapımı

C# Console For Döngüsü Yıldız Yapımı
0

C# Console uygulaması ile aşağıdaki ekran görüntüsünü yıldızlarla oluşturacak programı yazın…

*
 *
  *
   *
    *
     *
    *
   *
  *
 *
*
int i=0;
	  for(i=1;i<=6;i++)
	  {	
		if(i>1)
		{
		for(int k=1;k<i;k++)
		{
		Console.Write(" ");
		}
		Console.Write("*");		
		}
		else		
		{
		Console.Write("*");
		}
		Console.WriteLine();		
      }
	  for(int a=i-2;a>=1;a--)
	  {
	  for(int k=1;k<a;k++)
		{
		Console.Write(" ");
		}
		Console.Write("*");		
		Console.WriteLine();
	  }
	  	  Console.ReadLine();

yildiz2

Bu İçeriğe Tepkin Ne Oldu?
  • 3
    ba_ar_l_
    Başarılı
  • 1
    gayet_yi
    Gayet İyi
  • 0
    te_ekk_rler
    Teşekkürler
  • 0
    anlamad_m
    Anlamadım
  • 1
    yetersiz
    Yetersiz
İlginizi Çekebilir
Subscribe
Bildir
guest

This site uses Akismet to reduce spam. Learn how your comment data is processed.

0 Yorum
Inline Feedbacks
View all comments