from 4th statement , we can conclude that 7 , 3 ,8 cannot be the code.

from 3rd statement we conclude that two number is correct which will be in pair either (2,0) or (0,6) or (2,6)

from 5th statement ,we get the information that 0 must be in code and its place can't be 3rd place.

BY seeing all statement we can conclude 0 placed at first position .

4 placed at 2nd position because in 2nd statement its given one of these number is correct but wrong placed.

In first statement its given , one number is correct and well placed that is 2.

so, code = 042