Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio Code is not taking input from keyboard when I use C++ or Java

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.

enter image description here

like image 979
Abhishek Sharma Avatar asked May 08 '26 00:05

Abhishek Sharma


1 Answers

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.

like image 135
lbarqueira Avatar answered May 11 '26 01:05

lbarqueira



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!