We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 18e78cd + 8b7bfcf commit 6509314Copy full SHA for 6509314
factorial/factorial.swift
@@ -0,0 +1,7 @@
1
+var number: Int = 5 // Change the number here
2
+var fact: Int = 1
3
+var n: Int = number + 1
4
+for i in 1..<n {
5
+ fact = fact * i
6
+}
7
+print("Factorial of ",number," is: ", fact)
0 commit comments