#include <stdio.h>   
#include <stdio.h>   
void swap(int *, int *); //prototype of 
//the function    
int main()   
{   
    int a = 10;   
    int b = 20;    
    printf("Before swapping a=%d,b=%d\n”,a,b); 
    swap(&a,&b);   
    printf("After swapping a = %d, b = %d\n",a,b); // The values of actual parameters do change in        
                                                                                //  call by reference, a = 10, b = 20   
}   
 
void swap (int *a, int *b)   
{   
    int temp;    
       temp = *a;   
PROGRAMS USING CALL BY VALUE AND CALL BY REFERENCE IN 
C 
    *a=*b;   
    *b=temp;   
    printf("After swapping values in function a = %d, b = %d\n",*a,*b); // Formal parameters, a =  
                                                                                                                    20, b = 10    
}