0
Write a c program for swaping of two numbers
3 Réponses
+ 1
void swap(int *x,int *y)
{
int temp=*x;
*x=*y;
*y=temp;
}
This code snippet swaps the address of the two variables
0
#include <stdio.h>
int main() {
int x, y, temp;
printf("Enter the value of x and y\n");
scanf("%d%d", &x, &y);
temp = x;
x = y;
y = temp;
printf("After Swapping \n x = %d \n y = %d \n",x,y); return 0;
}