//Header Files [Standard Library]
#include
#include
// User defined functions swap with 2 pointer variables passed as an argument list
void swap(int*i,int*j)
{
// Local variable temp
int temp;
// swapping contents using third variable temp
temp=*i;
*i=*j;
*j=temp;
}
//Main function[Execution starts from main method]
void main()
{
int a,b;
//Function for clearing screen
clrscr();
//Taking input from user
printf("Enter value for a:");
scanf("%d",&a);
printf("Enter value for b:");
scanf("%d",&b);
//Printing on console
printf("**Before swapping**\n");
printf("value of a=%d\t",a);
printf("value of b=%d\n",b);
swap(&a,&b);
printf("**After swapping**\n");
printf("value of a=%d\t",a);
printf("value of b=%d",b);
// Function for holding screen on console
getch();
}