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.

Revisions

  1. batuhanozkose created this gist Jan 20, 2022.
    39 changes: 39 additions & 0 deletions main.c
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,39 @@
    #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]);
    }

    }