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

Can a pointer point to null?

1071


What is LINKED LIST? How can you access the last element in a linked list?

1075


How can I automatically locate a programs configuration files in the same directory as the executable?

1176


explain what are pointers?

1021


How is a structure member accessed?

1138


what is uses of .net

1742


hello freinds next week my interview in reliance,nybody has an idea about it intervew questions..so tell

2178


State the difference between realloc and free.

1092


Device an algorithm for weiler-atherton polygon clipping, where the clipping window can be any specified polygon

5958


Why string is used in c?

1010


What are the types of macro formats?

1126


Which one to choose from 'initialization lists' or 'assignment', for the use in the constructor?

1089


Write a program to implement queue.

1129


what are enumerations in C

1163


What are global variables?

1196