In this code snippet, why does the compiler not allow the value of y to change?
for(y in 1..100) y+=2
for(y in 1..100) y+=2A. y must be declared with var to be mutable
B. y is an implicitly immutable value
C. y can change only in a while loop
D. In order to change y, it must be declared outside of the loop
Answer: Option B
Related Questions on Kotlin Program
A. A new version of Java.
B. A JavaScript framework.
C. A statically-typed programming language for the JVM, Android, and browser.
D. A database management system.
Which platform does Kotlin primarily target?
A. Python Bytecode
B. JavaScript
C. JVM (Java Virtual Machine) Bytecode
D. PHP

Join The Discussion