C Programming Code Examples C > Functions Code Examples Swapping numbers using Function Call by Value Swapping numbers using Function Call by Value Function call by value is the default way of calling a function in C programming. Before we discuss function call by value, lets understand the terminologies that we will use while explaining this: Actual parameters: The parameters that appear in function calls. Formal parameters: The parameters that appear in function declarations. When we pass the actual parameters while calling a function then this is known as function call by value. In this case the values of actual parameters are copied to the formal parameters. Thus operations performed on the formal parameters don't reflect in the actual parameters. #include <stdio.h> void swapnum( int var1, int var2 ) { int tempnum ; /*Copying var1 value into temporary variable */ tempnum = var1 ; /* Copying var2 value into var1*/ var1 = var2 ; /*Copying temporary variable value into var2 */ var2 = tempnum ; } int main( ) { int number1 = 35, number2 = 45 ; printf("Before swapping: %d, %d", number1, number2); /*calling swap function*/ swapnum(number1, number2); printf("\nAfter swapping: %d, %d", number1, number2); }