Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SWIFT

Swift break with while Loop

// program to find first 5 multiples of 6

var i = 1

while (i<=10) {
  print("6 * (i) =",6 * i)

    if i >= 5 {
      break
   }
 
  i = i + 1
}
 
PREVIOUS NEXT
Tagged: #Swift #break #Loop
ADD COMMENT
Topic
Name
5+8 =