2 votes 2 votes The minimum number of temporary variables needed to swap the contents of two variables is: (a) 1 (b) 2 (c) 3 (d) 0 Programming in C programming + – goku asked Sep 14, 2015 goku 16.9k views answer comment Share Follow See all 0 reply Please log in or register to add a comment.
Best answer 2 votes 2 votes var a ,b; a=a+b; b=a-b; a=a-b; or a=a*b; b=a/b; a=a/b; no temporary variables is needed Saurav answered Sep 14, 2015 • selected Feb 25, 2016 by Pooja Palod Saurav comment Share Follow See all 2 Comments See all 2 2 Comments reply Vinay Yadav commented Sep 15, 2015 reply Follow Share I am also getting 0 (zero). 0 votes 0 votes Saurav commented Sep 15, 2015 reply Follow Share ...k then u r right 0 votes 0 votes Please log in or register to add a comment.
0 votes 0 votes #include <stdio.h> int main(void) { int a=5; int b=4; a=a^b; b=a^b; a=a^b; printf("%d %d",a,b); return 0; } Aditya answered Sep 15, 2015 Aditya comment Share Follow See all 0 reply Please log in or register to add a comment.
0 votes 0 votes Answer d Vishal Sathawane answered Feb 25, 2016 Vishal Sathawane comment Share Follow See all 0 reply Please log in or register to add a comment.