Program to Swipe numbers using pointer

#include<stdio.h>
#include<conio.h>
void swap(int *a,int *b);
void swap(int *a,int*b)
{
 int temp;
 temp= *a;
 *a=*b;
 *b=temp;
 printf("\n a %d",*a);
 printf("\n b %d",*b);
}
void main()
{
 clrscr();
 int a=5,b=4;
 swap (&a,&b);

 getch();
}

Leave a Reply