A

Admin • 670.22K Points
Coach

Q. Which of these is a correct use of a for-in loop?

  • (A) for 0 to 5 { print(i) }
  • (B) foreach i in 0...5 { print(i) }
  • (C) for i in 0...5 { print(i) }
  • (D) loop i = 0 to 5 { print(i) }
  • Correct Answer - Option(C)
  • Views: 1
  • Filed under category Swift (iOs)
  • Hashtags:

Explanation by: Admin
This is the valid for-in loop syntax in Swift for a closed range.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.