Skip to content

Instantly share code, notes, and snippets.

@mrnirva
Created September 4, 2020 12:34
Show Gist options
  • Save mrnirva/86e55d3b2fe9bc974e8c89c908c09c54 to your computer and use it in GitHub Desktop.
Save mrnirva/86e55d3b2fe9bc974e8c89c908c09c54 to your computer and use it in GitHub Desktop.
package donguler;
public class Donguler {
public static void main(String[] args) {
// Do - While Döngüsü
int sayi = 0;
do{
System.out.println("Merhaba Dünya");
}while(sayi > 5);
System.out.println("****************");
// 0'dan 100'e kadar sayıların toplamı
int sayac = 0, toplam = 0;
do{
sayac++;
toplam += sayac;
}while(sayac <= 100);
System.out.println("Toplam: "+toplam);
// Çıktı: 5151
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment