While taking input from the user using C++/Java, program is running successful and Visual Studio Code does asks user to input, but when I try to enter anything like a number or a character, it takes no input.

Your program is running in Output tab, therefore it is not possible to take input. Just enable Run in terminal in Visual Studio Code Settings.
Settings (ctrl+,) -> Search settings, look for code runner: run in terminal (check)
Note: It is supposed that you have Code Runner extension installed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With