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

How can I find out how much free space is available on disk?

619


Why do we use c for the speed of light?

597


what do you mean by inline function in C?

603


how to print the character with maximum occurence and print that number of occurence too in a string given ?

2024


What is the behavioral difference when include header file in double quotes (“”) and angular braces (<>)?

798






Explain how are 16- and 32-bit numbers stored?

771


What’s a signal? Explain what do I use signals for?

593


What is s in c?

596


pgm to find number of words starting with capital letters in a file(additional memory usage not allowed)(if a word starting with capital also next letter in word is capital cann't be counted twice)

1851


What is the easiest sorting method to use?

625


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

635


#include int main(){ int i=10; int *ptr=&i; *ptr=(int *)20; printf("%d",i); return 0; } Output: 20 can anyone explain how came the output is 20

1245


What does return 1 means in c?

575


int i=10; printf("%d %d %d", i, i=20, i);

996


What is a static variable in c?

655