Capgemini
Company
Programming
Basics
Give an example where pass by value gives an error and pass by reference rectifies the statement.
Read Solution (Total 4)
-
- Swapping of two numbers.As the changes made in formal argument will not get reflected in actual argument.
- 8 years agoHelpfull: Yes(11) No(17)
- while writing program of swapping two nos using function call ,if we call the function using call by value then the nos are not swapped but if done through call by refrence it gets swapped.
- 6 years agoHelpfull: Yes(3) No(0)
- when the formal argument accepting passed value is of pointer type. In this case it will not accept value directly.
- 7 years agoHelpfull: Yes(0) No(0)
- swapping of two numbers
- 5 years agoHelpfull: Yes(0) No(0)
Capgemini Other Question