without using arthematic operation ,how can you write the
logic for adding/substraction/multiplication?
Answer Posted / sankar
Without using arthematic operation adding two numbers:
#include<stdio.h>
int main()
{
int a=5,b=6;
while(b)
{
a=a^b;
b=(a^b)&b;
b=b<<1;
}
printf("The sum of a and b is: %d\n",a);
return 0;
}
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
Can we cast any other type to boolean type with type casting?
What is proper subset?
What is string in java?
Write a method that will remove given character from the string?
How to avoid memory leak in java?
What do you know about java?
What is constructor and its types?
What is tcp ip in java?
State the difference between strings and arrays.
Is java ee a framework?
What is difference between static and final?
How can we find the sum of two linked lists using stack in java?
Why is stringbuffer thread safe?
What is the purpose of using the java bean?
How to make object serializable in java?