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

can u write a program in C, which does not use = (eqaul)or
any arithmatic assignment(like -=,+=,*= etc) operator to
swap to number?

Answer Posted / musa

swapping x and y using z as intermediary

memcpy(&z, &x, sizeof(x));
memcpy(&x, &y, sizeof(x));
memcpy(&y, &z, sizeof(x));

Is This Answer Correct ?    2 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can I generate floating-point random numbers?

1125


any "C" function by default returns an a) int value b) float value c) char value d) a & b

1080


what is the c source code for the below output? 5555555555 4444 4444 333 333 22 22 1 1 22 22 333 333 4444 4444 5555555555

3063


Explain what are binary trees?

1072


What is the size of empty structure in c?

1078


Explain the difference between exit() and _exit() function?

1164


How can I prevent another program from modifying part of a file that I am modifying?

1051


Why we use conio h in c?

1222


main() { printf("hello"); fork(); }

1189


Can we use any name in place of argv and argc as command line arguments?

1065


How can I find the modification date and time of a file?

1081


What is the use of a ‘’ character?

1085


Why static variable is used in c?

1034


Why we not create function inside function.

2192


Describe the header file and its usage in c programming?

1062