C# Console Merdivenli yazdırma

Csharp Console Merdivenli yazdırma

Klavyeden girilen ifadeyi istenilen sayı kadar for döngüsü ile merdivenli paykasa kart şekilde ekrana yazdıran program

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace for10_yıldızlar
{
    class Program
    {
        static void Main(string[] args)
        {
            int sayi, x, y;
            string ifade;
            Console.Write("Kaç Yıldız veya satır olsun : ");
            sayi = Convert.ToInt16(Console.ReadLine());
            Console.Write("Ekrana ne yazdırmak istiyorsun : ");
            ifade = Console.ReadLine();
            for (x = 1 ; x <= sayi ; x++)
            {
                for (y = 1; y <= x; y++)
                {
                    Console.Write(ifade);
                }
                Console.WriteLine("");
            }
            Console.ReadKey();
        }
    }
}
Bu Yazıya Tepkin Nedir?
+1
0
+1
0
+1
0
+1
0
+1
0
+1
0
+1
0

Yorum Yap