calling a function

calling a function


calling a function is a method to invoking the function.

we can invoke function by two method


  1. call by value

  2. call by reference

call by value

In this method we pass the value or parameter while we calling the function and the parameter's value is copied to the actual function's parameters

in your example the value of x and y are copied to local variable x and y of function



Call by reference 

in this method we pass the memory location of variable as parameter when we calling the function.

in your example the memory location of x and y is stored into the a and b then we assessing the values at a and b by using * operator to check maximum out of them.


Example: