Özkan Karakuş

Top

C# Console Sayısal Loto Programlama

Edited 08/03/2020 Okuma Süresi 2 Dakika

Bugün Sizlere C# Da Console Sayısal Loto Programlama İçin Kodlar Paylaşacagım.

C# Console programında hazırlanmış rastgele 6 tane sayı üretip ekranda gösteren sayısal loto programı


using System.Collections.Generic;
using System.Linq;
using System.Text;
 
namespace ConsoleApplication3
{
    class Program
    {
        static void Main(string[] args)
        {
            {
                Random rnd = new Random();
 
                int[] rastgelesayi = new int[6];
 
                for (int i = 0; i < 6; i++)
                {
 
                    rastgelesayi[i] = rnd.Next(1, 50);
 
                }
 
                Array.Sort(rastgelesayi);
 
                for (int i = 0; i < 6; i++)
                {
 
                    Console.Write(rastgelesayi[i] + " ");
 
                }
 
                Console.ReadLine();
            }
        }
     }

Web hosting by Somee.com