C# Sayı tahmin oyunu

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

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            Random rastgele = new Random();
            int sayi = rastgele.Next(100);
            int sayac = 1;
            while (true)
            {
                Console.WriteLine("Tahmin girin: ");
                int tahmin = Convert.ToInt32(Console.ReadLine());

                if (tahmin > sayi)
                {
                    Console.WriteLine("Tahminin büyük");
                }
                else if (tahmin < sayi)
                {
                    Console.WriteLine("Tahmin küçük");
                }
                else
                {
                    Console.WriteLine("Tebrikler, {0} tahminde bildin.", sayac);
                    break;
                }
                sayac++;
            }
        }
    }
}

C# Not Harfi Bulma

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

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            while (true)
            {
                byte not;
                Console.Write("Not Girin: ");
                string notal = Console.ReadLine();
                if (byte.TryParse(notal, out not))
                {
                    if ((not >= 0) && (not <= 100))
                    {
                        if (not >= 90)
                        {
                            Console.WriteLine("Not: A1");
                        }
                        else if ((not >= 80) && (not <= 89))
                        {
                            Console.WriteLine("Not: A2");
                        }
                        else if ((not >= 75) && (not <= 79))
                        {
                            Console.WriteLine("Not: B1");
                        }
                        else if ((not >= 70) && (not <= 74))
                        {
                            Console.WriteLine("Not: B2");
                        }
                        else if ((not >= 65) && (not <= 69))
                        {
                            Console.WriteLine("Not: C1");
                        }
                        else if ((not >= 60) && (not <= 64))
                        {
                            Console.WriteLine("Not: C2");
                        }
                        else if ((not >= 55) && (not <= 59))
                        {
                            Console.WriteLine("Not: D1");
                        }
                        else if ((not >= 50) && (not <= 54))
                        {
                            Console.WriteLine("Not: D2");
                        }
                        else if ((not >= 40) && (not <= 49))
                        {
                            Console.WriteLine("Not: E");
                        }
                        else if ((not >= 0) && (not <= 39))
                        {
                            Console.WriteLine("Not: F1");
                        }
                    }
                    else
                    {
                        Console.WriteLine("\nNotlar 0-100 aralığında olmalıdır.\nTekrar girin: ");
                        continue;
                    }

                    Console.WriteLine("\nDevam etmek istiyor musunuz? (E/H)");
                    string devam = Console.ReadLine();
                    if ((devam == "E") || (devam == "e"))
                    {
                        Console.Write("\n");
                        continue;
                    }
                    else
                    {
                        break;
                    }
                }
                else
                {
                    Console.WriteLine("Notlar 0-100 aralığında olmalıdır.\n");
                    
                }
            }

        }
    }
}

C# ile iki sayının toplamını alma

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

namespace odev1
{
    class Program
    {
        static void Main(string[] args)
        {
            int a, b;
            string a1, a2;
            Console.Write("İlk sayıyı girin: ");
            a1 = Console.ReadLine();

            while (true)
            {
                if (int.TryParse(a1, out a))
                {
                    break;
                }
                else
                {
                    Console.Write("İlk sayı için geçerli değer girilmedi. Tekrar girin: ");
                    a1 = Console.ReadLine();
                }
            }

            Console.Write("İkinci sayıyı girin: ");
            a2 = Console.ReadLine();

            while (true)
            {
                if (int.TryParse(a2, out b))
                {
                    break;
                }
                else
                {
                    Console.Write("İkinci sayı için geçerli değer girilmedi. Tekrar girin: ");
                    a2 = Console.ReadLine();
                }
            }

            Console.WriteLine("\nİlk sayı: " + a);
            Console.WriteLine("İkinci sayı: " + b);
            Console.WriteLine("Toplamı: " + (a + b));
        }
    }
}

C# dairenin alan ve çevresini hesaplama

C# ile kullanıcıdan yarıçapı isteyip dairenin alan ve çevresini hesaplatma formülü

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

namespace deneme
{
    class Program
    {
        static void Main(string[] args)
        {
            // PI'yi sabitle
            const double PI = 3.14;
            double yaricapi, alan, cevre;
            Console.Write("Dairenin yarı çapını giriniz:");

            // kullanıcıdan yarıçapı iste
            yaricapi = Convert.ToDouble(Console.ReadLine());

            // alanı hesapla
            alan = PI * yaricapi * yaricapi;

            // çevreyi hesapla
            cevre = 2 * PI * yaricapi;

            // sonuçları ekrana yazdır
            Console.WriteLine("Alan: " + alan);
            Console.WriteLine("Çevre: " + cevre);
        }
    }
}