- Get link
- X
- Other Apps
The code for this program is given below:
#include<stdio.h>
#include<conio.h>
void swap(int *x,int *y)
{
int temp;
temp=*x;
*x=*y;
*y=temp;
}
int main()
{
int a , b;
clrscr();
printf("Enter Value Of A:");
scanf("%d",&a);
printf("Enter Value Of B:");
scanf("%d",&b);
swap(&a,&b);
printf("After Swapping...");
printf("\nA=%d",a);
printf("\nB=%d",b);
getch();
return 0;
}
Output:
Comments
Post a Comment