swapping of two numbers without using third variable using
AND and OR operators

Answer Posted / vignesh1988i

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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is hashing in c?

638


Can include files be nested?

619


How can you pass an array to a function by value?

597


What are loops in c?

545


What is structure of c program?

597






Why does this code crash?

610


If you know then define #pragma?

668


What are the advantages of c preprocessor?

701


What is the concatenation operator?

602


List the difference between a While & Do While loops?

627


What are the data types present in c?

617


Can the curly brackets { } be used to enclose a single line of code?

709


Explain why can’t constant values be used to define an array’s initial size?

848


What is typedef?

657


Explain what is wrong in this statement?

626