Uncategorized

Write a simple program to validate passing by value and passing

1 Write a simple program to validate passing by value and passing by reference. 2 Initialize a variable and display its value. 3 Pass the variable by value to a function. Change the value of the variable in the pass by value function. Display the modified value inside the function. 4 After the pass by value function returned, display the value again in the main function. 5 Pass the same variable, now passing by reference to another function. Change the value of the variable in the pass by reference function. Display the modified value inside the function.

Leave a Reply

Your email address will not be published. Required fields are marked *