program to swap the value by call by refrence..

#include<stdio.h>
int swap(int*,int*); //functon decleretion
void main()
{
int a,b;
clrscr();
printf(“Enter two values”);
scanf(“%d%d”,&a,&b);
swap(&a,&b);
printf(“%d %d”,a,b);
getch();
}
// function definition swap
int swap(int *p,int *q)
{
int t;
t=*p;
*p=*q;
*q=t;
}

3 thoughts on “program to swap the value by call by refrence..

Leave a Reply

Your email address will not be published.