c++ print text

#include <iostream>

int main() {
    // Step 1: Include necessary header file for input/output operations
    using namespace std;

    // Step 2: Define the main function
    int x = 42; // Step 3: Declare and initialize an integer variable

    // Step 4: Use cout to print text to the console
    cout << "Hello, World!" << endl; // Step 5: Output the text "Hello, World!"

    // Step 6: Use variables in cout
    cout << "The value of x is: " << x << endl; // Output: "The value of x is: 42"

    // Step 7: Return 0 to indicate successful program execution
    return 0;
}