Write a program to interchange two variables without using
the third variable?
Answer Posted / tom macdonald
#include<stdio.h>
void main()
{
int x,y;
printf("enter x and y: ");
scanf("%d%d",&x,&y);
x^=y;
y^=x;
x^=y;
printf("elements after swapping: %d,%d\n",x,y);
}
| Is This Answer Correct ? | 29 Yes | 32 No |
Post New Answer View All Answers
regarding pointers concept
Do you know the use of 'auto' keyword?
Explain union. What are its advantages?
how can f be used for both float and double arguments in printf? Are not they different types?
Can include files be nested?
What’s a signal? Explain what do I use signals for?
Write a program on swapping (100, 50)
Is null a keyword in c?
What do you mean by dynamic memory allocation in c?
In C language what is a 'dangling pointer'?
Why we use int main and void main?
How do we open a binary file in Read/Write mode in C?
What is function definition in c?
Can a function argument have default value?
Why is event driven programming or procedural programming, better within specific scenario?