Control Flow Swift:-
For-In loops:- for in loop to iterate over a sequence, such as items in the array, ranges of numbers, or characters in a string.
Exp. let animals = ["Cat", "dog", "cow ", "lion"]
for animalName in animals{
print ("This ia \(animalName)")
}
Output :-
Cat
dog
cow
lion
Next :- for-in loops with numeric ranges.
for index in 1...5{
print("index value is :- \(index)")
}
Comments
Post a Comment