what happening is ...
when ever I enter a value(eg: 45) in serial monitor, it's printing the value(45) and 0 .
I don't know why 0 is getting print every time
Can anyone say why this is happening?
(I'm new to arduino)
likely your issue is due to the newline you send at the end. parseInt() with stop at the new line and then when you come back the Serial buffer is not empty so you proceed and parseInt fails and thus returns 0
What have you got Line ending set to in the Serial monitor ?
Please follow the advice given in the link below when posting code . Use code tags when posting code here to make it easier to read and copy for examination