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

what is associativity explain what is the precidence for * and & , * and ++ how the folloing declaration work 1) *&p; 2) *p++;

2126


What is a rvalue?

943


What is const volatile variable in c?

767


What is a stream water?

888


Where we use clrscr in c?

886


Write a program to implement queue.

862


What are different storage class specifiers in c?

841


how could explain about job profile

1635


Why #include is used in c language?

781


Difference between constant pointer and pointer to a constant.

814


What is c preprocessor mean?

1027


What is a null pointer in c?

819


Why can't I perform arithmetic on a void* pointer?

817


What is the acronym for ansi?

795


What is a pointer and how it is initialized?

806