Created
January 20, 2022 19:19
-
-
Save batuhanozkose/c20b0934f588c7b1990fd397a820b9d2 to your computer and use it in GitHub Desktop.
C'de Basit olarak; While , DoWhile , For , ForEach kullanımı.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #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