write a program to swap Two numbers without using temp variable.

Answer Posted / abhi

void swap(int *a,int *b)
{
if(*a == *b)
return;
*a^=*b;
*b^=*a;
*a^=*b;
}

Is This Answer Correct ?    461 Yes 195 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Do you have any idea how to compare array with pointer in c?

796


Why should I prototype a function?

812


What functions are used in dynamic memory allocation in c?

767


What is unary operator?

833


What is the difference between abs() and fabs() functions?

823






What is New modifiers?

865


what is the difference between 123 and 0123 in c?

917


i = 25;switch (i) {case 25: printf("The value is 25 ");case 30: printf("The value is 30 "); When the above statements are executed the output will be : a) The value is 25 b) The value is 30 c) The value is 25 The value is 30 d) none

803


How are variables declared in c?

814


What is dynamic memory allocation?

1017


How do shell structures work?

771


Explain what happens if you free a pointer twice?

782


write a program to copy the string using switch case?

2591


a direct address that identifies a location by means of its displacement from a base address or segment a) absolute address b) relative address c) relative mode d) absolute mode

862


What is volatile variable in c with example?

761