Anyone can fix my code for without serial monitor?
If it works with the Serial monitor it will work with any program that can send serial data from the PC. Some terminal emulators allow characters to be sent as they are typed and do not require you to press return. Is that what you had in mind ?