how to add two numbers without using arithmetic operators?
Answer Posted / sanjay bhosale
int x=12382,y=2;
int xor, and, temp;
and = x & y;
xor = x ^ y;
while(and != 0 )
{
and <<= 1;
temp = xor ^ and;
and &= xor;
xor = temp;
}
printf(" sum is : %d",xor);
Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
An organised method of depicting the use of an area of computer memory used to signify the uses for different parts of the memory a) swap b) extended memory c) memory map d) all of the above
What is the use of #include in c?
Find duplicates in a file containing 6 digit number (like uid) in O (n) time.
Is c is a high level language?
how to capitalise first letter of each word in a given string?
Why isnt there a numbered, multi-level break statement to break out
What could possibly be the problem if a valid function name such as tolower() is being reported by the C compiler as undefined?
how many key words availabel in c a) 28 b) 31 c) 32
how to make a scientific calculater ?
What is the advantage of an array over individual variables?
What is the purpose of type declarations?
Can I initialize unions?
When c language was developed?
What are pointers? What are stacks and queues?
Write a program to check whether a number is prime or not using c?