call by value in c++

#include <iostream>

// Function prototype
void modifyValue(int x);

int main() {
    // Declare and initialize a variable
    int num = 5;

    // Display the original value
    std::cout << "Original value: " << num << std::endl;

    // Call the function with the variable
    modifyValue(num);

    // Display the modified value
    std::cout << "Modified value: " << num << std::endl;

    return 0;
}

// Function definition
void modifyValue(int x) {
    // Modify the parameter value
    x = 10;

    // Display the modified value within the function
    std::cout << "Modified value within function: " << x << std::endl;
}