write a program to swap Two numbers without using temp variable.
Answer Posted / yash paranjape
a=a^b;
b=a^b;
a=a^b;
i.e
a^=b;
b^=a;
a^=b;
more simplifie i.e in just one line
a^=b^=a^=b;
This also works fine
| Is This Answer Correct ? | 2 Yes | 1 No |
Post New Answer View All Answers
Why do we use stdio h and conio h?
Write a code to generate a series where the next element is the sum of last k terms.
Explain can you assign a different address to an array tag?
What do you know about the use of bit field?
What is LINKED LIST? How can you access the last element in a linked list?
What are logical errors and how does it differ from syntax errors?
What are local static variables?
What is the function of this pointer?
hi any body pls give me company name interview conduct "c" language only
Can you write the algorithm for Queue?
Is c# a good language?
Here is a good puzzle: how do you write a program which produces its own source code as output?
What is bss in c?
If i have an array 0 to 99 i.e,(Size 100) I place the values 1 to 100 randomly like a[0]=29,a[1]=56 upto array[99].. the values are only between 1 to 100. getting the array values by using scanf.. If i entered one wrong element value line a[56]=108. how can i find it.. and also how to find the missing value in 1 to 100.. and i want to replace the missing values.. any one of them know please post your answer..
How does struct work in c?