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...

write a c program to add two integer numbers without using
arithmetic operator +

Answer Posted / maksim

a = 53;
int c = 0b10000000;
int d = c;
printf("c=%d\n",c);
s = 30;

while(c>0){
int d = c;
if (a&d){
while ((s&d)&&(d<=128)) {
s = (s&~d);
d = d<<1;
}
d = (d<=128)?d:0;
s = s|d;
}
c = c>>1;
}
printf("s=%d\n",s);

Is This Answer Correct ?    3 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

When do you not use the keyword 'return' when defining a function a) Always b) Never c) When the function returns void d) dfd

1010


Why doesnt that code work?

1074


Where are the auto variables stored?

1090


Multiply an Integer Number by 2 Without Using Multiplication Operator

724


What is the role of && operator in a program code?

1017


What does typedef struct mean?

1045


When the macros gets expanded?

1339


how do you execute a c program in unix.

1075


What is the use of #include in c?

1036


will u please send me the placement papers to my mail???????????????????

1794


Write a program of advanced Fibonacci series.

1094


There is a practice in coding to keep some code blocks in comment symbols than delete it when debugging. How this affect when debugging?

1243


while initialization of array why we use a[][2] why not a[2][]...?

2303


Explain the ternary tree?

968


Can math operations be performed on a void pointer?

970