Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

Write a program to print factorial of given number without using recursion?

950


Explain the difference between exit() and _exit() function?

1108


Is there a way to compare two structure variables?

1057


Explain what is the benefit of using enum to declare a constant?

1019


Is null always defined as 0(zero)?

1041


In a header file whether functions are declared or defined?

1077


What does a function declared as pascal do differently?

1039


what are enumerations in C

1106


What do you mean by recursion in c?

1055


Can a pointer be volatile in c?

930


write a program to concatenation the string using switch case?

2034


What is a lookup table in c?

1047


Is fortran faster than c?

982


What are types of preprocessor in c?

1014


What does %c mean in c?

1027