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
What is self-referential structure in c programming?
What is void main () in c?
How do I get a null pointer in my programs?
What is the value of c?
What are register variables in c?
write a program to reverse a every alternetive words in a string in a place. EX: Input is "this is the line of text" Output should be "shit is eht line fo text" Please any one tell me code for that.
Is c easy to learn?
What are conditional operators in C?
Write a C program to count the number of email on text
What are the types of c language?
What is class and object in c?
What is calloc malloc realloc in c?
Explain what is the difference between functions abs() and fabs()?
What is volatile variable how do you declare it?
What are the general description for loop statement and available loop types in c?