14 Mayıs 2019 Salı

Dizide Arama Yapma Programı





             string[] isimler = new string[11];
            int x = 0;

            for (int i = 0; i < 11; i++)
            {
                Console.Write("İsim Gir : ");
                isimler[i] = Console.ReadLine();
            }

            Console.Write("Aramak İstediğin İsim : ");
            string a = Console.ReadLine();

            for (int i = 0; i < 11; i++)
            {
                if (a == isimler[i])
                {
                    x++;
                }
            }

            Console.Write(a + " isminden " + x + " tane var.");

            Console.ReadKey();
            

Hiç yorum yok:

Yorum Gönder