Created
September 4, 2020 12:24
-
-
Save mrnirva/f74bf292f86e41bc99fe3d3a7f41ab24 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) { | |
// 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