Write a program to interchange two variables without using
the third variable?
Answer Posted / vinay tiwari
void main()
{
int a,b;
printf("enter two no ");
scanf("%d%d",&a,&b);
printf("a=%d and b=%d",a,b);
a=a^b;
b=a^b;
a=a^b;
printf("a=%d and b=%d",a,b);
getch();
}
| Is This Answer Correct ? | 22 Yes | 13 No |
Post New Answer View All Answers
How does #define work?
Differentiate between new and malloc(), delete and free() ?
What is malloc calloc and realloc in c?
what is the structure pointer?
What are the benefits of organizational structure?
cin.ignore(80, _ _);This statement a) ignores all input b) ignores the first 80 characters in the input c) ignores all input till end-of-line d) iteration
What is a pointer variable in c language?
Explain the difference between malloc() and calloc() in c?
Is swift based on c?
What are pointers really good for, anyway?
What is enumerated data type in c?
Why can arithmetic operations not be performed on void pointers?
What is %g in c?
Explain is it better to bitshift a value than to multiply by 2?
What are the 4 data types?