Skip to content

Instantly share code, notes, and snippets.

@batuhanozkose
Created January 20, 2022 19:19
Show Gist options
  • Save batuhanozkose/c20b0934f588c7b1990fd397a820b9d2 to your computer and use it in GitHub Desktop.
Save batuhanozkose/c20b0934f588c7b1990fd397a820b9d2 to your computer and use it in GitHub Desktop.
C'de Basit olarak; While , DoWhile , For , ForEach kullanımı.
#include <stdio.h>
int main() {
//While kullanımı
int sayi = 0;
while (sayi < 10) {
printf("%d\n", sayi);
sayi++;
}
//Do While kullanımı
int sayi2 = 0;
do {
printf("%d\n", sayi2);
sayi2++;
} while (sayi2 < 10);
//For kullanımı
for (int i = 0; i < 10; i++) {
printf("%d\n", i);
}
//ForEach kullanımı
int dizi[5] = {1, 2, 3, 4, 5};
for (int i = 0; i < 5; i++) {
printf("%d\n", dizi[i]);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment