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 / sanjay bhosale

int x=12382,y=2;
int xor, and, temp;
and = x & y;
xor = x ^ y;

while(and != 0 )
{
and <<= 1;
temp = xor ^ and;
and &= xor;
xor = temp;
}
printf(" sum is : %d",xor);

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is null valid for pointers to functions?

1131


What is call by reference in functions?

1363


formula to convert 2500mmh2o into m3/hr

953


PLS U SENS ME INTERVIEW O. MY EMAIL ADD, SOFIYA.SINGH@GMAIL.COM

2160


What is printf () in c?

1031


How can I list all of the predefined identifiers?

947


I heard that you have to include stdio.h before calling printf. Why?

1025


What is the heap?

1176


Write a program, where i have a grid with many cells, how many paths are possible from one point to other desired points.

1200


What should malloc(0) do? Return a null pointer or a pointer to 0 bytes?

1036


what are the advanced features of functions a) function declaration and prototypes b) calling functions by value or by reference c) recursion d) all the above

1098


What is a structural principle?

1112


Explain c preprocessor?

1061


How to set file pointer to beginning c?

1168


Explain can the sizeof operator be used to tell the size of an array passed to a function?

1029