Here’s the general form of a repeat-while loop for Swift
repeat {
statements
} while condition
For example,
repeat {
//take input from standard IO into variable n
} while n >= 0
This loop will repeat for all positive values of n.
Here’s the general form of a repeat-while loop for Swift
repeat {
statements
} while condition
For example,
repeat {
//take input from standard IO into variable n
} while n >= 0
This loop will repeat for all positive values of n.