Ana içeriğe atla

Console Ekranından Değer Okuma (Örnek)

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

namespace ConsoleDegerOkuma_Ornek
{
    class Program
    {
        static void Main(string[] args)
        {
            /*
                2.ogrencinin
             *  3 tane notu istensin
             * 
             *  1.öğrencinin notu ,2.öğrenciden fazla mı değil mi ? buna bakılarak ekran true / false ifadesini görelim
             *  not ortalamasi
             */

            int ort1, ort2;
            ort1 = ort2 = 0;

            Console.WriteLine("1.Ogrencinin 1.Notu : ");
            ort1 += Convert.ToInt32(Console.ReadLine()); // ort1 =
            Console.WriteLine("1.Ogrencinin 2.Notu : ");
            ort1 += Convert.ToInt32(Console.ReadLine());
            Console.WriteLine("1.Ogrencinin 3.Notu : ");
            ort1 += Convert.ToInt32(Console.ReadLine());
            Console.WriteLine("2.Ogrencinin 1.Notu : ");
            ort2 += Convert.ToInt32(Console.ReadLine());
            Console.WriteLine("2.Ogrencinin 2.Notu : ");
            ort2 += Convert.ToInt32(Console.ReadLine());
            Console.WriteLine("2.Ogrencinin 3.Notu : ");
            ort2 += Convert.ToInt32(Console.ReadLine());

            ort1 = ort1 / 3;
            ort2 /= 3;

            bool mantiksalSonuc = true;
            mantiksalSonuc = ort1 >= ort2;
            Console.WriteLine("1.Ogrencinin Not Ort > 2.Ogrencinin Not Ort : {0}",mantiksalSonuc);
        }
    }
}

Yorumlar