Call by value:
-Here call by value refers as we call the function and pass the variable value instead of passing refrence of variable.
#include < iostream>
using namespace std;
void swap(int a,int b)
cout<<"After swapping numbers"<< a<<" "<< b<< endl;
cout<<"Before function calling"<< endl;
cout<<"i and j is: "<< i<<"t"<< j<< endl;
cout<<"After function calling"<< endl;
cout<<"i and j is: "<< i<<" "<< j;
Before function calling
i and j is:
After swapping numbers 20 10
After function calling
i and j is: 10 20
-In this program, we just pass variable without any refrence just by value, so whatever done in the function are not affect the actual variable which we pass in the function so this kind of concept are called as call by value.