Skip to content

Instantly share code, notes, and snippets.

@mrnirva
Created September 4, 2020 12:24
Show Gist options
  • Save mrnirva/f74bf292f86e41bc99fe3d3a7f41ab24 to your computer and use it in GitHub Desktop.
Save mrnirva/f74bf292f86e41bc99fe3d3a7f41ab24 to your computer and use it in GitHub Desktop.
package donguler;
public class Donguler {
public static void main(String[] args) {
// While Döngüsü - Faktöriyel Örneği
// Aşağıdaki döngü 10! faktöriyeli bulup yazar
// 10! = 1*2*3*4*5*6*7*8*9*10
int n = 10, faktoriyel = 1;
while(n >= 1){
faktoriyel *= n;
n--;
}
System.out.println("10! = "+faktoriyel);
// 10! = 3628800
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment