#include<stdio.h>
#include<conio.h>
void swap(int *a,int *b)
{
int c;
c=*a;
*a=*b;
*b=c;
printf("a=%d\n",*a);
printf("b=%d\n",*b);
}
void main()
{
int a,b;
printf("enter the two number\n");
scanf("%d%d",&a,&b);
printf("without swapping\n");
printf("a=%d\n",a);
printf("b=%d\n",b);
printf("after swapping\n");
swap(&a,&b);
}
#include<conio.h>
void swap(int *a,int *b)
{
int c;
c=*a;
*a=*b;
*b=c;
printf("a=%d\n",*a);
printf("b=%d\n",*b);
}
void main()
{
int a,b;
printf("enter the two number\n");
scanf("%d%d",&a,&b);
printf("without swapping\n");
printf("a=%d\n",a);
printf("b=%d\n",b);
printf("after swapping\n");
swap(&a,&b);
}