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

difference of two no's with out using - operator

Answer Posted / supri

see subtraction itself is the addition of the number with
its 2's complement....
add(int a,int b)
{
if(!a)
return b;
else
return(add((a&b)<<1,a^b));
}
main()
{
int a,b;
scanf("%d%d",&a,&b);
b=add(~b,1);
printf("%d",add(a,b));
return;
}
u can try this...

Is This Answer Correct ?    2 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can I avoid the abort, retry, fail messages?

1138


What are the advantages of using linked list for tree construction?

1104


differentiate built-in functions and user – defined functions.

1092


Why we use int main and void main?

1082


how to solve "unable to open stdio.h and conio.h header files in windows 7 by using Dos-box software

3322


Is c easy to learn?

988


What is use of integral promotions in c?

1151


Why do we need functions in c?

1024


How does struct work in c?

1090


Why is c faster?

1109


What is a string?

1122


Is null valid for pointers to functions?

1177


Explain what are its uses in c programming?

1064


What are the key features in c programming language?

1076


Why do we use stdio h and conio h?

1093