Program Code
 #include<stdio.h>
 void main(){
  int A = 5, B = 9;
  printf('Value of A is %d\n',A);
  printf('Value of B is %d\n',B);
  swap( &A , &B );
  printf('Value of A after swapping is %d\n',A);
  printf('Value of B after swapping is %d\n',B);
 }
    
 void swap( int *Pa , int *Pb){
  int temp = *Pa;
  *Pa = *Pb;
  *Pb = temp;
 }
Memory Map
Address  BYTE 1  BYTE 2  BYTE 3  BYTE 4  Variable 
60
56
52
48
44
40
36
32
28
24
20
16
12
8Program Memory
4Program Memory
0Reserved By Os
Code Output
Explanation