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 numbers without using arithmetic operators.

Answer Posted / sneha

#include <stdio.h>

int add(int a,int b)
{
if(!a)
return b;
else
return add((a&b)<<1,a^b);
}

void main()
{
int a=2, b=3, c;
c = add(a,b);
printf("%d\n",c);
}

Is This Answer Correct ?    15 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is null always equal to 0(zero)?

990


What is structure in c definition?

984


where are auto variables stored? What are the characteristics of an auto variable?

1019


Why we use stdio h in c?

983


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

2145


Who is the main contributor in designing the c language after dennis ritchie?

953


Can a local variable be volatile in c?

937


How can I read and write comma-delimited text?

1010


What is an array? What the different types of arrays in c?

1104


What is pointer to pointer in c language?

1050


What are header files and what are its uses in C programming?

1133


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?

1199


which is an algorithm for sorting in a growing Lexicographic order

1747


I have seen function declarations that look like this

994


What is the behavioral difference when include header file in double quotes (“”) and angular braces (<>)?

1272