Doubt Regarding Encoder

Azhaganandhan:
this is the code am using. am getting output as 3453 regularly please help me out in the code

The code prints out a series of 1s and 0s and you say you get 3453 as output? That doesn't match up.

Also the code as you posted suffers from a lack of code tags, and two lines that appear to be comments miss // at the start.

What is connected to pins 35, 37, 39 and 41?

Why is pin 37 set to LOW in setup(), then to HIGH in loop() and kept that way? The line where it's set to LOW in loop() is commented out.