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
Is null valid for pointers to functions?
What is call by reference in functions?
formula to convert 2500mmh2o into m3/hr
PLS U SENS ME INTERVIEW O. MY EMAIL ADD, SOFIYA.SINGH@GMAIL.COM
What is printf () in c?
How can I list all of the predefined identifiers?
I heard that you have to include stdio.h before calling printf. Why?
What is the heap?
Write a program, where i have a grid with many cells, how many paths are possible from one point to other desired points.
What should malloc(0) do? Return a null pointer or a pointer to 0 bytes?
what are the advanced features of functions a) function declaration and prototypes b) calling functions by value or by reference c) recursion d) all the above
What is a structural principle?
Explain c preprocessor?
How to set file pointer to beginning c?
Explain can the sizeof operator be used to tell the size of an array passed to a function?