Are you looking for Hello World in C++ Code? Let’s know it.
Here is a simple “Hello, World!” program in C++:
#include <iostream>
int main() {
std::cout << "Hello, World!" << std::endl;
return 0;
}
To compile and run the program, you will need a C++ compiler. Here is how you can compile and run the program using the g++ compiler:
- Open a terminal window.
- Save the above code to a file named “hello.cpp”.
- Navigate to the directory where you saved the file.
- Type the following command to compile the program:
g++ hello.cpp -o hello
This will create an executable file named “hello”. - Type the following command to run the program:
./hello
You should see the following output:
Hello, World!