I was able to do everything so far except this, don't know why but I got this error Unresolved reference:x for last line print(x).
fun main(args:Array<String>) {
var liste = IntRange(3,19)
var bolundu = 1
for (x in liste)
for (y in IntRange(2,x))
if (x % y != 0)
bolundu = 0
if (bolundu == 1)
print(x)
}
I don't understand what is the problem, why it doesn't match that x with the one in the for loop?
for xloop only contains one statement: thefor yloop. Use{}if you want multiple statements within the loop (it a good idea to use braces even for single-statement loops to make it clear where it begins and ends).