Swift - Control Flow
What will be printed by this Swift code?
let number = 15
switch number {
case let x where x % 3 == 0:
print("Divisible by 3")
case let x where x % 5 == 0:
print("Divisible by 5")
default:
print("Other")
}What will be printed by this Swift code?
let number = 15
switch number {
case let x where x % 3 == 0:
print("Divisible by 3")
case let x where x % 5 == 0:
print("Divisible by 5")
default:
print("Other")
}15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions