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

How to compare array with pointer in c?

1066


What are keywords in c with examples?

1050


write a c program to do the following: a) To find the area of a triangle. b) To convert the temperature from Fahrenheit to Celsius. c) To convert the time in hours : minutes : seconds to seconds.

1958


What is the hardest programming language?

1107


Tell me what is null pointer in c?

1032


What is #include called?

1004


What is page thrashing?

1035


Is it better to bitshift a value than to multiply by 2?

1061


Explain what are the __date__ and __time__ preprocessor commands?

1088


When do we get logical errors?

1087


How do you determine a file’s attributes?

1028


Are there any problems with performing mathematical operations on different variable types?

1007


typedef enum { html, java, javascript, perl, cgi } lang;The above statement defines a : a) Union b) User defined type c) Enumerated variable d) none

1170


What is the heap?

1168


What is the best style for code layout in c?

1065