Computer Science, asked by shyamNayak, 9 months ago

Explain the concept of CALL BY VALUE. State its advantages and disadvantages.​

Answers

Answered by futureking
0

Answer:

In call by value method, the value of the actual parameters is copied into the formal parameters. In other words, we can say that the value of the variable is used in the function call in the call by value method.

Mark me as brainliest if you liked my answer...

Thank you

Answered by pavithranatarajan855
1

Answer:

definition:

The call by value method of passing arguments to a function copies the actual value of an argument into the formal parameter of the function. ... By default, C programming uses call by value to pass arguments. In general, it means the code within a function cannot alter the arguments used to call the function.

example:

int add(a,b){

}//function def

add(6,7)//function call

Advantages:

The method doesn't change the original variable, so it is preserving data. Whenever a function is called it, never affect the actual contents of the actual arguments

Disadvantages

1.Changes to actual parameters can also modify corresponding argument variables.

2.In this method, arguments must be variables.

3.You can't directly change a variable in a function body.

4.Sometime argument can be complex expressions.

Explanation:

Similar questions