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
What is linked hashmap and its features?
What is generic class?
How do you clear a list in java?
Are arrays immutable in java?
What does it mean to be immutable?
What is the main difference between java platform and other platforms?
What is advantage of java?
When should you make a function static?
What is private static in java?
What is literal example?
what is session in java?
What steps are taken when the OS shifts from one-thread execution to another?
What are the three types of design patterns?
What is Session reduplication and how its done?
Can a class extend 2 classes in java?