Funky chess board doubt in code

sir why is the value in visited array changing from 0 to 1 automatically?