Write a C program to accept two natural numbers and swap the contents from one another without using any extra variable and without using any arithmetic operators
Answers
Answered by
0
Answer:
#include<stdio.h>
#include<conio.h>
int main()
{
int x,y;
printf("x = ");
scanf("%d",&x);
printf("y = ");
scanf("%d",&y);
printf("\nBefore swap x = %d and y = %d\n", x, y);
printf("After swap x = %d and y = %d\n", y, x);
getch();
return 0;
}
Explanation:
There is no use of extra variables and any arithmetic operator.
Similar questions