- Open Visual Studio and create a new project.
- Select "Console App" as the project type and choose "C++" as the programming language.
- In the solution explorer, right-click on the "Source Files" folder and select "Add" > "New Item".
- Choose "C++ File (.cpp)" and name it "main.cpp".
- In the "main.cpp" file, write the following code:
#include <iostream>
using namespace std;
int main() {
cout << "Hello, World!" << endl;
return 0;
}
- Build the solution to compile the code.
- Press "Ctrl + F5" to run the program and see the output "Hello, World!" in the console.