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 |
which is the best antivirus and how to update it
where does malloc() function get the memory?
Why structure is used in c?
#include<stdio.h> void main() { int a=10,b=20,c=30; printf("%d",scanf("%d%d%d",&a,&b,&c)); } what is the output for this?
What is a void * in c?
What are enumerated types?
How can you increase the size of a statically allocated array?
What is the difference between pure virtual function and virtual function?
What are types of preprocessor in c?
What does void main return?
What is #define used for in c?
1)which of following operator can't be overloaded. a)== b)++ c)?! d)<=