/* program to try to add one to a function parameter - illustrate pass by value */ #include using namespace std; void trytoadd1(int); //function prototype int main() { int k = 5; cout << "in main - before call: "<< k << endl; trytoadd1(k); cout << "in main - after call: "<< k << endl; // system("pause"); return 0; } /* function that tries to add one to its parameter */ void trytoadd1(int x) //x is receiving the value of k { cout << "in function - before adding: " << x << endl; x++; cout << "in function - after adding: " << x << endl; return; }