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...

How do we swap or interchange any 2 numbers without using
Temporary variable...Anybody can pls answer it.. Thanks in
Advance

Answer Posted / raghuram.a

int x,y;

x =x-y;
y =y+x;
x =y-x;

or

int x,y;

x=x^y;
y=x^y;
x=x^y;

Is This Answer Correct ?    11 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why is not a pointer null after calling free?

993


Is null valid for pointers to functions?

1137


main(){char *str;scanf("%s",str);printf("%s",str); }The error in the above program is: a) Variable 'str' is not initialised b) Format control for a string is not %s c) Parameter to scanf is passed by value. It should be an address d) none

1326


in linking some of os executables are linking name some of them

2096


Is a house a shell structure?

1132


What are the output(s) for the following ? #include char *f() {char *s=malloc(8); strcpy(s,"goodbye")} main() { char *f(); printf("%c",*f()='A'); }

1155


Explain do array subscripts always start with zero?

1196


Explain the properties of union. What is the size of a union variable

1157


What is bin sh c?

1015


What is nested structure with example?

1044


Where can I get an ansi-compatible lint?

1123


What does *p++ do?

999


write a c program to find the largest and 2nd largest numbers from the given n numbers without using arrays

2210


what is the different bitween abap and abap-hr?

2268


I need previous papers of CSC.......plz help out by posting them.......

2269