Call by Value in C++

Call by value is a method of passing arguments to a function copies the actual value of an argument to new variables

Source code :

#include <iostream>

using namespace std;

int myFunc(int,int);


int main()
{
	myFunc(75,41);
	return 0;
}

int myFunc(int a,int b)
{
	cout << "The sum is " << a+b ;
	return 0;
}

Output :

The sum is 116

Output :


                

Comments :