//Program to recieve the address of variable using pointer through functions.
#include<stdio.h>
#include<conio.h>
main()
{
int a,b;
clrscr();
printf(" enter the value of a and b:");
scanf("%d%d",&a,&b);
printf("\n values of a and b before swapping");
printf("\n a=%d b=%d",a,b);
void swap(int *x,int *y);
swap(&a,&b);
printf("\n values of a and b after swapping");
printf("\n a=%d b=%d",a,b);
getch();
}
void swap(int*x,int *y)
{
int t;
t=*x;
*x=*y;
*y=t;
}
#include<stdio.h>
#include<conio.h>
main()
{
int a,b;
clrscr();
printf(" enter the value of a and b:");
scanf("%d%d",&a,&b);
printf("\n values of a and b before swapping");
printf("\n a=%d b=%d",a,b);
void swap(int *x,int *y);
swap(&a,&b);
printf("\n values of a and b after swapping");
printf("\n a=%d b=%d",a,b);
getch();
}
void swap(int*x,int *y)
{
int t;
t=*x;
*x=*y;
*y=t;
}