Free help with homework

Why join Brainly?

  • ask questions about your assignment
  • get answers with explanations
  • find similar questions



This Is a Certified Answer

Certified answers contain reliable, trustworthy information vouched for by a hand-picked team of experts. Brainly has millions of high quality answers, all of them carefully moderated by our most trusted community members, but certified answers are the finest of the finest.
The apply the call by value in a function,  you have to use the formal parameter specification as per call by value.   The language tells you how to specify for call by value or call by reference mechanisms.  You have to follow that way as told by the rule of the language.

It is the default mechanism in a programming language, in general.  You just have to write the variable name (identifier) or expression as the parameter of the function, when calling the function.

Suppose you have a function defined as follows.
   integer  My_add( integer A,  integer B) 
           integer  C =  A + B ;
            //  A = 10;   B = 7;
In the main program you call the function by the following procedural (sequential control) statement.

   integer X, Y, Z ;
   X = 5;
   Y = 4 ;
   Z =  My_add ( X, Y) ;
you can also write  :    Z = My_add (5, 4);

Here the formal parameters A and B in the function My_add are call by value parameters.  The parameters X and Y in the main program will not be changed after the addition function is executed.

Thus even the commented statements in the function are executed, the values of X and Y in the main program do not change.

0 0 0
The Brain
  • The Brain
  • Helper
Not sure about the answer?
Learn more with Brainly!
Having trouble with your homework?
Get free help!
  • 80% of questions are answered in under 10 minutes
  • Answers come with explanations, so that you can learn
  • Answer quality is ensured by our experts