-
Write a Fibonacci numbers generator using recursion.
-
Write code to find the Factorial of a given Number.
-
Write Swift Program to Check Whether a given Number is Palindrome or Not
-
Write subscript for below given struct
struct WeekDays {
var days = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday"]
}
- What is the output of this piece of code? Explain the difference in behavior of
color
andweekday
variables.
var color = "blue"
var weekday = "Monday"
let closure = { [color] in
print("My favorite color is \(color)")
print("Today is \(weekday)")
}
color = "green"
weekday = "Tuesday"
closure()