Xcode doesn't run simple code

Whenever I try to run a code(any C++ code that takes input) in Xcode, it builds successfully, but it never completes running. The bar on the top keeps saying running, and the input is never registered.
On a similar note, while trying to setup VS Code also, I was faced with an error that wchar file was not found.
Kindly help