Skip to content

Beginner-friendly C# notes with simple English&Turkish ✨ ----- Basit İngilizce&Türkçe başlangıç ​​seviyesindeki C# notları✨

Notifications You must be signed in to change notification settings

ebrar-M/csharp-beginner-notes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 

Repository files navigation

Stars Forks Last Commit C#

---

🌍 Languages


🇹🇷 TR Türkçe

🟩 C# Programlama Dili - Temelleri

1. 📖 C# Nedir?

  • C# (C Sharp), Microsoft tarafından geliştirilmiş modern, nesne yönelimli bir programlama dilidir.
  • .NET platformunda çalışır.
  • Windows uygulamaları, oyun geliştirme (Unity 🎮), web uygulamaları (ASP.NET) ve daha fazlasında kullanılır.
  • Güçlü tip güvenliği ve zengin kütüphaneleri vardır.

2. 🏗️ İlk C# Programı

using System;

class Program {
    static void Main() {
        Console.WriteLine("Merhaba C# 🚀");
    }
}

📌 Açıklama:

  • using System; → kütüphaneyi ekler.
  • Console.WriteLine() → ekrana yazı yazar.
  • Main() → programın giriş noktasıdır.

3. 🔑 Değişkenler ve Veri Tipleri

int sayi = 10;            // Tam sayı
double pi = 3.14;         // Ondalık sayı
char harf = 'A';          // Tek karakter
string isim = "Ebrar";    // Metin
bool dogruMu = true;      // Mantıksal değer

4. 🧮 Operatörler

int a = 5, b = 2;
Console.WriteLine(a + b); // Toplama
Console.WriteLine(a - b); // Çıkarma
Console.WriteLine(a * b); // Çarpma
Console.WriteLine(a / b); // Bölme
Console.WriteLine(a % b); // Mod

5. 🔁 Koşullar ve Döngüler

If - Else

int yas = 18;
if (yas >= 18) {
    Console.WriteLine("Reşitsiniz ✅");
} else {
    Console.WriteLine("Reşit değilsiniz ❌");
}

Switch

int gun = 3;
switch (gun) {
    case 1: Console.WriteLine("Pazartesi"); break;
    case 2: Console.WriteLine("Salı"); break;
    case 3: Console.WriteLine("Çarşamba"); break;
    default: Console.WriteLine("Bilinmiyor"); break;
}

For Döngüsü

for (int i = 1; i <= 5; i++) {
    Console.WriteLine(i);
}

While Döngüsü

int sayac = 0;
while (sayac < 3) {
    Console.WriteLine("Sayaç: " + sayac);
    sayac++;
}

6. 📦 Metotlar (Fonksiyonlar)

using System;

class Program {
    static int Kare(int x) {
        return x * x;
    }

    static void Main() {
        Console.WriteLine(Kare(5));
    }
}

7. 🏗️ Sınıflar ve Nesneler (OOP)

using System;

class Ogrenci {
    public string Isim;
    public int Yas;

    public void Bilgi() {
        Console.WriteLine("Ad: " + Isim + ", Yaş: " + Yas);
    }
}

class Program {
    static void Main() {
        Ogrenci ogr = new Ogrenci();
        ogr.Isim = "Ebrar";
        ogr.Yas = 20;
        ogr.Bilgi();
    }
}

8. 🚀 Diziler ve Listeler

Dizi

int[] sayilar = {1, 2, 3, 4, 5};
foreach (int s in sayilar) {
    Console.WriteLine(s);
}

Liste (Generic Collection)

using System.Collections.Generic;

List<string> meyveler = new List<string>() { "Elma", "Armut", "Muz" };
foreach (string meyve in meyveler) {
    Console.WriteLine(meyve);
}

9. 🌈 İpuçları

✔️ Console.WriteLine → ekrana yazdırmak için
✔️ List<T> → esnek veri yapısı
✔️ Unity oyun motoru öğrenmek için C# bilmek şart 🎮
❌ Bellek yönetimi elle yapılmaz → Garbage Collector otomatik temizler.


🎯 Mini Alıştırmalar

  1. Kullanıcıdan isim al → “Merhaba, [isim]” yazdır.
  2. 1’den 100’e kadar olan sayıların toplamını bulan program yaz.
  3. Bir Araba sınıfı oluştur → markası ve modeli olsun, ekrana yazdır.
  4. Bir liste oluştur (int) → en büyük elemanı bul.

📌 Son Söz

C#, modern yazılım geliştirmede güçlü bir araçtır.


🇬🇧 GB English

🟩 C# Programming Language - Fundamentals

1. 📖 What is C#?

  • C# (C Sharp) is a modern, object-oriented programming language developed by Microsoft.
  • It runs on the .NET platform.
  • It is used in Windows applications, game development (Unity 🎮), web applications (ASP.NET), and more.
  • It has strong type safety and rich libraries.

2. 🏗️ First C# Program

using System;

class Program {
static void Main() {
Console.WriteLine("Hello C# 🚀");
}
}

📌 Description:

  • using System; → adds the library.
  • Console.WriteLine() → writes text to the screen.
  • Main() → is the entry point of the program.

3. 🔑 Variables and Data Types

int number = 10; // Integer
double pi = 3.14; // Decimal number
char letter = 'A'; // Single character
string name = "Ebrar"; // Text
bool true = true; // Boolean value

4. 🧮 Operators

int a = 5, b = 2;
Console.WriteLine(a + b); // Addition
Console.WriteLine(a - b); // Subtraction
Console.WriteLine(a * b); // Multiplication
Console.WriteLine(a / b); // Division
Console.WriteLine(a % b); // Mode

5. 🔁 Conditions and Loops

If - Else

int age = 18;
if (age >= 18) {
Console.WriteLine("You are a minor ✅");
} else {
Console.WriteLine("You are a minor ❌");
}

Switch

int day = 3;
switch (day) {
case 1: Console.WriteLine("Monday"); break;
case 2: Console.WriteLine("Tuesday"); break;
case 3: Console.WriteLine("Wednesday"); break;
default: Console.WriteLine("Unknown"); break;
}

For Loop

for (int i = 1; i <= 5; i++) { 
Console.WriteLine(i);
}

While Loop

int counter = 0;
while (counter < 3) { 
Console.WriteLine("Counter: " + counter); 
counter++;
}

6. 📦 Methods (Functions)

usingSystem;

class Program { 
static int Square(int x) { 
return x * x; 
} 

static void Main() { 
Console.WriteLine(Square(5)); 
}
}

7. 🏗️ Classes and Objects (OOP)

using System;

class Student {
public string Name;
public int Age;

public void Information() {
Console.WriteLine("Name: " + Name + ", Age: " + Age);
}
}

class Program {
static void Main() {
Student student = new Student();
student.Name = "Ebrar";
student.Age = 20;
student.Information();
}
}

8. 🚀 Arrays and Lists

Array

int[] numbers = {1, 2, 3, 4, 5};
foreach (int s in numbers) {
Console.WriteLine(s);
}

List (Generic Collection)

using System.Collections.Generic;

List<string> fruits = new List<string>() { "Apple", "Pear", "Banana" };
foreach (string fruit in fruits) {
Console.WriteLine(fruit);
}

9. 🌈 Tips

✔️ Console.WriteLine → for printing to the screen ✔️ List<T> → flexible data structure ✔️ C# knowledge is required to learn the Unity game engine 🎮 ❌ Memory management is not done manually → Garbage Collector cleans automatically.


🎯 Mini Exercises

  1. Get the user's name → print "Hello, [name]".
  2. Write a program that finds the sum of numbers from 1 to 100.
  3. Create a 'Car' class → print the make and model.
  4. Create a list ('int') → find the largest element.

📌 Final Word

C# is a powerful tool in modern software development.

You can use it in Windows applications, Unity games, web services, and more. In short: The seriousness of Java + the power of C++ + the support of Microsoft = C# 💚 Windows uygulamaları, Unity oyunları, web servisleri ve daha fazlasında kullanabilirsin.
Kısacası: Java’nın ciddiyeti + C++’ın gücü + Microsoft’un desteği = C# 💚

About

Beginner-friendly C# notes with simple English&Turkish ✨ ----- Basit İngilizce&Türkçe başlangıç ​​seviyesindeki C# notları✨

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published