1. Anasayfa
  2. Programlama Temelleri

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

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

Fon Döngüsü ile

       *
      ***
     *****
    *******
     *****
      ***
       *

Şeklinde Ekran görüntüsü oluşturan programı C# Console uygulamasını yazın..

  for (int i = 1; i < 10; i += 2) {
      for (int j = 0; j < 9 - i / 2; j++)
        Console.Write(" ");

      for (int j = 0; j < i; j++)
        Console.Write("*");

      	Console.WriteLine();
    }

    for (int i = 7; i > 0; i -= 2) {
      for (int j = 0; j < 9 - i / 2; j++)
        Console.Write(" ");

      for (int j = 0; j < i; j++)
        Console.Write("*");

      Console.Write("n");
    }
	  
	  Console.ReadLine();

yildiz

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

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

1 Yorum
Inline Feedbacks
View all comments
can

2 for ile yapamazmıyız bunu ?