How to add two numbers without using arithmetic operators?
Answer Posted / selloorhari
Hi Nitish,
If we will do the LOGICAL OR function then we will get
either 1 or 0.
If we will do the BITWISE OR then we will get the largest of
the two..
For
ex:
Let us take, First number as 2 and Second number as 3..
Then as per the first case we will get 1 as the output.
10(2) || 11(3) -> 1(1)
As per the second case the output will be 3..
10(2) | 11(3) -> 11(3).
Ok
| Is This Answer Correct ? | 14 Yes | 12 No |
Post New Answer View All Answers
Explain 'bus error'?
What does sizeof int return?
Can a program have two main functions?
What is ## preprocessor operator in c?
#include
void main(){ int a; a=1; while(a-->=1) while(a-->=0); printf("%d",a); }
What are the different properties of variable number of arguments?
Multiply an Integer Number by 2 Without Using Multiplication Operator
What is a structure in c language. how to initialise a structure in c?
In this assignment you are asked to write a multithreaded program to find the duplicates in an array of 10 million integers. The integers are between -5000,000 to 5000,000 and are generated randomly. Use 10 threads, each thread works on 1000,000 integers. Compare the time needed to accomplish the task with single thread of execution program. Do not include the time to fill the array with integers in the execution time.
How can I manipulate strings of multibyte characters?
Tell me can the size of an array be declared at runtime?
write a proram to reverse the string using switch case?
Is c still relevant?
How many levels of pointers can you have?