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

Explain how do you view the path?

658


Why should I prototype a function?

643


What is header file definition?

571


What is the use of ?: Operator?

670


How many types of functions are there in c?

586






Why header files are used?

647


What is c token?

612


Write a C program that will accept a hexadecimal number as input and then display a menu that will permit any of the following operations to be carried out: Display the hexadecimal equivalent of the one's complement. (b) Carry out a masking operation and then display the hexadecimal equivalent of the result. (c) Carry out a bit shifting operation and then display the hexadecimal equivalent of the result. (d) Exit. If the masking operation is selected, prompt the user lor the type of operation (bitwise and, bitwise exclusive or, or bitwise or) and then a (hexadecimal) value for the mask. If the bit shifting operation is selected. prompt the user for the type of shift (left or right), and then the number of bits. Test the program with several different (hexadecimal) input values of your own choice.

4843


Explain what is page thrashing?

612


What does %p mean c?

633


How do you generate random numbers in C?

660


Explain the difference between getch() and getche() in c?

566


What is restrict keyword in c?

646


difference between native and cross compilers

1672


What does sizeof return c?

608