Write a program to interchange two variables without using
the third variable?

Answer Posted / satish

#include<stdio.h>
void main()
{
int x,y;
printf("enter x and y: ");
scanf("%d%d",&x,&y);
x^=y^=x^=y;
printf("elements after swapping: %d,%d\n",x,y);
}

Is This Answer Correct ?    20 Yes 26 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is main return c?

505


Is c dynamically typed?

659


What are reserved words?

637


Give basis knowledge of web designing ...

1561


What is define directive?

627






"C" language developed by "Dennis Ritchie" at AT & T. his remarks are a) too general, too abstract b) could deal with only specific problems c) lost generality of BCPL and B restored d) no remarks

641


What do you mean by recursion in c?

613


How can I list all of the predefined identifiers?

566


How would you rename a function in C?

602


Is null always defined as 0(zero)?

598


Do string constants represent numerical values?

899


Does c have an equivalent to pascals with statement?

561


Function which gives a pointer to a binary trees const an integer value at each code, return function of all the nodes in binary tree.?

608


Explain what is the benefit of using an enum rather than a #define constant?

706


What are the different categories of functions in c?

631