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

What type of function is main ()?

1090


How can I delete a file?

1124


What is atoi and atof in c?

1135


What is hash table in c?

1078


what is the significance of static storage class specifier?

2343


Difference between macros and inline functions? Can a function be forced as inline?

1351


What is the size of array float a(10)?

1193


If a variable is a pointer to a structure, then which operator is used to access data members of the structure through the pointer variable?

1311


What are the advantages of c preprocessor?

1317


What does double pointer mean in c?

1258


An organised method of depicting the use of an area of computer memory used to signify the uses for different parts of the memory a) swap b) extended memory c) memory map d) all of the above

1218


What is difference between arrays and pointers?

1151


Give differences between - new and malloc() , delete and free() ?

1153


Why c is called procedure oriented language?

1107


What are the basic data types associated with c?

1318