Question: Which code snippet correctly shows a for loop using a range to display "1 2 3 4 5 6"?

  1. `for(z in 1..7) println("$z ")`
  2. `for(z in 1..6) print("$z ")`
  3. `for(z in 1 to 6) print("$z ")`
  4. `for(z in 1..7) print("$z ")`

Answer: The correct answer of the above question is Option B:`for(z in 1..6) print("$z ")`