Ignore what I'm trying to manage here. I'm only curious why it doesn't accept "if" statement in this for loop. As I stated it says "cannot convert from int to boolean". Why do you think it says so?
That expression should be realizes an boolean in side the if, otherwise compilation error.
Try to this code: -