But I was trying to take input a character in the same way. I have already applied the technique that you suggested for me. But I want to take a character. Is there any way in the same manner??

Thanking you in advance