Skip to main content

app-ads.txt

 google.com, pub-2203413632152319, DIRECT, f08c47fec0942fa0

Control Flow - Swift


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