How to take care of noise for Peak-to-Peak detection of sine wave??

Magician:
What programming language is it?

Well. I just used it and it works on Arduino..... it gave me no error..

So any comments about the noise??