write a program to swap Two numbers without using temp variable.
Answer Posted / yash paranjape
int main()
{
int a,b;
printf("enter the two numbers");
scanf("%d%d",&a,&b);
a^=b^=c^=a;//swap a and b
printf("%d%d",a,b);//numbers r swapped
}
| Is This Answer Correct ? | 82 Yes | 189 No |
Post New Answer View All Answers
What is static identifier?
How can I recover the file name given an open stream or file descriptor?
Write a program for Overriding.
What is pragma in c?
What is calloc() function?
a linearly ordered set of data elements that have the same structure and whose order is preserved in storage by using sequential allocation a) circular b) ordinary c) array d) linear list
Where are the auto variables stored?
How can a program be made to print the name of a source file where an error occurs?
What is the use of static variable in c?
Why & is used in c?
what do u mean by Direct access files? then can u explain about Direct Access Files?
What does %p mean c?
How can I make it pause before closing the program output window?
How to implement a packet in C
What is the difference between char array and char pointer?