---
- C, Dennis Ritchie tarafından 1972’de geliştirilmiş bir programlama dilidir.
- Hızlı ⏱️, düşük seviyeli (donanım yakın) ama güçlüdür.
- İşletim sistemleri (Linux, Windows çekirdeği), gömülü sistemler ve performans odaklı projelerde kullanılır.
- Birçok modern dilin (C++, Java, C#, Go) atasıdır.
#include <stdio.h>
int main() {
printf("Merhaba C 🚀\n");
return 0;
}📌 Açıklama:
#include <stdio.h>→ standart giriş/çıkış kütüphanesini ekler.main()→ programın başlangıç noktasıdır.printf()→ ekrana yazdırır.return 0;→ programı başarıyla bitirir.
int sayi = 10; // Tam sayı
float pi = 3.14; // Ondalık sayı
char harf = 'A'; // Tek karakter
double buyukPi = 3.141592653; // Daha hassas ondalıkint a = 5, b = 2;
printf("%d\n", a + b); // Toplama
printf("%d\n", a - b); // Çıkarma
printf("%d\n", a * b); // Çarpma
printf("%d\n", a / b); // Bölme
printf("%d\n", a % b); // Modint yas = 18;
if (yas >= 18) {
printf("Reşitsiniz ✅\n");
} else {
printf("Reşit değilsiniz ❌\n");
}int gun = 3;
switch (gun) {
case 1: printf("Pazartesi\n"); break;
case 2: printf("Salı\n"); break;
case 3: printf("Çarşamba\n"); break;
default: printf("Bilinmiyor\n");
}for (int i = 1; i <= 5; i++) {
printf("%d\n", i);
}int sayac = 0;
while (sayac < 3) {
printf("Sayaç: %d\n", sayac);
sayac++;
}#include <stdio.h>
int kare(int x) {
return x * x;
}
int main() {
printf("%d\n", kare(5));
return 0;
}int sayilar[5] = {1, 2, 3, 4, 5};
for (int i = 0; i < 5; i++) {
printf("%d\n", sayilar[i]);
}int sayi = 10;
int *ptr = &sayi;
printf("Deger: %d\n", sayi);
printf("Adres: %p\n", &sayi);
printf("Pointer ile değer: %d\n", *ptr);📌 İşaretçiler C’nin en güçlü (ve en kafa karıştırıcı 😅) özelliklerinden biridir.
✔️ printf → ekrana yazdırmak için
✔️ scanf → kullanıcıdan giriş almak için
✔️ Bellek yönetimini öğren → malloc, free
❌ Dizilerde sınırın dışına çıkma → segfault (program çökebilir)
- Kullanıcıdan 2 sayı al → toplamasını ve çarpmasını ekrana yazdır.
- 1’den 100’e kadar olan sayıların toplamını bulan program yaz.
- Bir dizideki en büyük sayıyı bulan program yaz.
C dili, yazılım dünyasının temel taşlarından biridir.
Düşük seviyeli kontrol (bellek, donanım) sağlar ama aynı zamanda hızlıdır.
Kısacası: C öğrenmek, diğer dilleri daha kolay kavramanı sağlar. 🔥
- C is a programming language developed by Dennis Ritchie in 1972.
- It is fast, low-level (close to hardware), but powerful.
- It is used in operating systems (Linux, Windows kernel), embedded systems, and performance-oriented projects.
- It is the ancestor of many modern languages (C++, Java, C#, Go).
#include <stdio.h>
int main() {
printf("Hello C 🚀\n");
return 0;
}📌 Description:
#include <stdio.h>→ Adds the standard input/output library.main()→ the starting point of the program.printf()→ prints to the screen.return 0;→ terminates the program successfully.
int number = 10; // Integer
float pi = 3.14; // Decimal number
char letter = 'A'; // Single character
double bigPi = 3.141592653; // More precise decimalint a = 5, b = 2;
printf("%d\n", a + b); // Addition
printf("%d\n", a - b); // Subtraction
printf("%d\n", a * b); // Multiplication
printf("%d\n", a / b); // Division
printf("%d\n", a % b); // Modeint age = 18;
if (age >= 18) {
printf("You are a minor ✅\n");
} else {
printf("You are a minor ❌\n");
}int day = 3;
switch (day) {
case 1: printf("Monday\n"); break;
case 2: printf("Tuesday\n"); break;
case 3: printf("Wednesday\n"); break;
default: printf("Unknown\n");
}for (int i = 1; i <= 5; i++) {
printf("%d\n", i);
}int counter = 0;
while (counter < 3) {
printf("Counter: %d\n", counter);
counter++;
}#include <stdio.h>
int square(int x) {
return x * x;
}
int main() {
printf("%d\n", square(5));
return 0;
}int nums[5] = {1, 2, 3, 4, 5};
for (int i = 0; i < 5; i++) {
printf("%d\n", nums[i]);
}int nums = 10;
int *ptr = &nums;
printf("Value: %d\n", nums);
printf("Address: %p\n", &nums);
printf("Value with pointer: %d\n", *ptr);📌 Pointers are one of C's most powerful (and most confusing 😅) features.
✔️ printf → print to the screen
✔️ scanf → get user input
✔️ Learn memory management → malloc, free
❌ Out-of-bounds in arrays → segfault (may crash the program)
- Get 2 numbers from the user → print their addition and multiplication.
- Write a program to find the sum of numbers from 1 to 100.
- Write a program to find the largest number in an array.
The C language is one of the cornerstones of the software world. It provides low-level control (memory, hardware) but is also fast. In short: Learning C will make it easier to grasp other languages. 🔥