Navigate this page
hide
Compiling codes every time you want to run a program is time-consuming. This is where the Visual Studio Code extension Code Runner helps. It enables you to run a variety of languages in Visual Studio Code. This guide will show how to easily see the output in Visual Studio Code with just one click.
Install Code Runner
Follow the below steps to install the Code Runner extension in VS Code:
- From the sidebar, click on the Extensions tab.
Open the Extensions tab from the sidebar. - In the search bar, type “Code Runner.”
Search for Code Runner. - Click on Install.
Click on the Install button.
See the output of your code
To see the output of any program, we use Code Runner. Follow these steps:
- Open the program you want to run. Here, I have opened a PHP program.
This is a sample PHP code that prints Hello World. - Click on the Run button on the top-right corner of the VS Code. Alternatively, you can press Ctrl + Alt + N (Command + Option + N for Mac users).
Click on the Run button. - You’ll notice the output in the terminal.
This is the output.