WHILE LOOPS #2

More while loops.

//Display the first 20 numbers in the seven times table //

let multiplier = 7

let upperLimit = 20

var counter = 1

while counter <= upperLimit {

let result = multiplier * counter

print ("\(multiplier) times \(counter) = \(result)")

counter = counter + 1

}

 

Happy coding!

 

M