swapping of two numbers without using third variable using
AND and OR operators
Answers were Sorted based on User's Feedback
Answer / ramesh reddy
a = a^b; b =a^b; a =a^b;
or
a=a+b; b=a-b; a=a-b;
| Is This Answer Correct ? | 43 Yes | 2 No |
however we can implement using EXoR , where it is made of
AND and OR gate too....
x=90;
y=51;
x^=y^=x;
the value of x & y will be swapped.
| Is This Answer Correct ? | 8 Yes | 8 No |
What are preprocessor directives?
write a C program to print the program itself ?!
Write a small C program to determine whether a machine's type is little-endian or big-endian.
Function calling procedures? and their differences? Why should one go for Call by Reference?
How does free() know how many bytes to free?
Is exit(status) truly equivalent to returning the same status from main?
how to write a cprogram yo get output in the form * *** ***** ******* ********* ******* ***** *** *
how i m write c program 1.check prime number 2.prime number series
what is foreign key in c language?
What is infinite loop?
Why can't I perform arithmetic on a void* pointer?
What is call by value in c?