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
How do you define a variable?
Is alive in java?
Can we call the constructor of a class more than once for an object?
What do you understand by classes in java?
Why parsing is done?
2) Suppose there are 5 directories having lot of files (say txt files) in each directory. 2 things :- 2.1) You want to search for filenames which have a particular pattern. 2.2) Out of these filtered files you want to search for a particular keyword or a search string. How can you achieve this?
How do you use compareto?
What is a method declaration?
How do you input a string in java?
What are the 3 types of control structures?
Can we restart a thread already started in java?
How do you start a thread?
How to sort an unsorted array in java?
When we should use serialization?
Tell me about different OOPS concepts.