CPP Program to Implementation of Call by Value


To write a C++ program to find the value of a number raised to its power that demonstrates a function using call by value.


  • 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.
  • In this case, changes made to the parameter inside the function have no effect on the argument.


  1. Start the program.
  2. Declare the variables.
  3. Get two numbers as input
  4. Call the function power to which a copy of the two variables is passed.
  5. Inside the function, calculate the value of x raised to power y and store it in p.
  6. Return the value of p to the main function.
  7. Display the result.
  8. Stop the program.


using namespace std;
int areaofrect(int l,int b)
return l*b;	
int main()
int l,b;
cout<<"area of rectanle :"<<areaofrect(l,b);
return 0;



7 9


area of rectangle :63


Thus, Implementation of Call by Value was executed successfully.

Leave a Comment