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
Not all reserved words are written in lowercase. TRUE or FALSE?
What language is c written?
How can you draw circles in C?
What is the use of #define preprocessor in c?
what are the different storage classes in c?
Difference between constant pointer and pointer to a constant.
What are pointers really good for, anyway?
Explain what happens if you free a pointer twice?
Write a c program to build a heap method using Pointer to function and pointer to structure ?
What is the use of void pointer and null pointer in c language?
What are derived data types in c?
I need a sort of an approximate strcmp routine?
What are the characteristics of arrays in c?
Can static variables be declared in a header file?
Explain how do you use a pointer to a function?