gcc run c++

// Step 1: Include necessary headers
#include <iostream>

// Step 2: Define the main function
int main() {
    // Step 3: Declare variables or perform other setup if needed

    // Step 4: Print a message to the console
    std::cout << "Hello, World!" << std::endl;

    // Step 5: Return an exit code from the main function
    return 0;
}
# Step 6: Compile the C++ program using gcc
gcc -o output_file_name input_file_name.cpp
# Example:
gcc -o hello_world hello_world.cpp
# Step 7: Run the compiled executable
./output_file_name
# Example:
./hello_world