loop in swift 5 code example
Example 1: swift for loop
for n in 1...5 {
print(n)
}
Example 2: how to loop swift
for n in 1...5 {
print(n)
}
// Output: 1 2 3 4 5
for n in 1...5 {
print(n)
}
for n in 1...5 {
print(n)
}
// Output: 1 2 3 4 5