Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SWIFT

repeat...while Loop Swift

// program to display numbers

var i = 1, n = 5

// repeat...while loop from 1 to 5
repeat {
  
  print(i)

  i = i + 1

} while (i <= n)
 
PREVIOUS NEXT
Tagged: #Loop #Swift
ADD COMMENT
Topic
Name
5+6 =