Kotlin
Kotlin
val num = 10
var factorial: Long = 1
for (i in 1..num) {
// factorial = factorial * i;
factorial *= i.toLong()
}
println("Factorial of $num = $factorial")
}
question2.
Kotlin Program to Check Whether a Character is Alphabet or Not
answer:
fun main(args: Array<String>) {
val c = '*'
if (c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z')
println("$c is an alphabet.")
else
println("$c is not an alphabet.")
}