You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
programming-examples/c/Basic/To swap the address of two ...

20 lines
408 B
C

#include <stdio.h>
#include <conio.h>
void swap(int *,int *);
void main()
{
int a=10,b=20;
clrscr();
printf("\nVALUES OF a AND b BEFORE SWAPING ARE %d %d",a,b);
swap(&a,&b);
printf("\nVALUES OF a AND b AFTER SWAPING ARE %d %d",a,b);
getch();
}
void swap(x,y)
int *x,*y;
{
int t;
t=*x;
*x=*y;
*y=t;
}