Created
September 4, 2020 12:01
-
-
Save mrnirva/13772b5b8ffbcd0c130772ce3598f389 to your computer and use it in GitHub Desktop.
This file contains 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
package donguler; | |
public class Donguler { | |
public static void main(String[] args) { | |
// 10'dan Geriye Sayan Örnek | |
for(int i=10; i>0; i--){ | |
System.out.println(i); | |
} | |
System.out.println("*************************"); | |
// Çift Sayıları Yazdıran Örnek | |
for(int i=0; i<15; i+=2){ | |
System.out.print(i + " "); | |
} | |
System.out.println("\n*************************"); | |
int toplam = 0; | |
// Dışarıdan verilen değişkenle sayacı toplamak | |
for(int i=0; i<1000; i++){ | |
toplam += i; | |
} | |
System.out.println("Toplam: "+toplam); | |
System.out.println("*************************"); | |
int toplamIcIce = 0; | |
// İç içe for döngüsü | |
for(int i=0; i<10; i++){ | |
// Her defasında 10 kez buraya girer | |
for(int j=0; j<10; j++){ | |
toplamIcIce += i + j; | |
} | |
} | |
System.out.println("Toplam İç İçe: "+toplamIcIce); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment