Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

Answer Posted / tom macdonald

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

Is This Answer Correct ?    29 Yes 32 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a spanning Tree?

1597


What are different storage class specifiers in c?

1096


while loop contains parts a) initialisation, evalution of an expression,increment /decrement b) initialisation, increment/decrement c) condition evalution d) none of the above

1247


Are the variables argc and argv are local to main?

1320


Explain how do you sort filenames in a directory?

1043


What is the difference between array_name and &array_name?

1307


What is string function in c?

990


What is file in c language?

1010


Why isn't any of this standardized in c? Any real program has to do some of these things.

1217


What is wrong in this statement? scanf(ā€œ%dā€,whatnumber);

1245


What is meant by errors and debugging?

1112


Explain how do you convert strings to numbers in c?

1082


What is the argument of a function in c?

1053


How do you use a 'Local Block'?

1173


What is array of structure in c?

1186