Write a program to exchange two variaables without temp

Answer Posted / sujith

another quick way is,

void main()
{
int a = 10, b = 5;
a ^= b ^= a ^= b;
}

Is This Answer Correct ?    7 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Which is an example of a structural homology?

785


Explain what is wrong with this statement? Myname = ?robin?;

1019


why use "return" statement a) on executing the return statement it immediately transfers the control back to the calling program b) it returns the value present in the parentheses return, to the calling program c) a & b d) none of the above

609


Can 'this' pointer by used in the constructor?

614


how to make a scientific calculater ?

1565






What is a volatile keyword in c?

638


What is operator promotion?

629


If jack lies on Mon, Tue Wed and jill lies on Thursday, Friday and Saturday. If both together tell they lied yesterday. So c the given options and then c cos in the given dates one will be saying the truth and one will be lying. I got Thursday as option because jack is saying the truth he lied yest but jill is lying again as he lies on that day.

1791


Explain the use of #pragma exit?

699


how to build a exercise findig min number of e heap with list imlemented?

1612


Why is c known as a mother language?

749


a) Identify the following declarations. Ex. int i (integer variable) float a[l0](array of 10 real nos) int (*f())() void *f int (*f()) [] void *f int f[] [] [] char *(*f) () int (*f[]) [] float(*f) [] [] float **f int ******f

1587


What is c variable?

552


What are the types of c language?

556


Tell me when would you use a pointer to a function?

607