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 / lookog

int add2(int a,int b)
{int s;
char *p=(unsigned)a;
s=&p[b];
return(s);
}

The previous soln with int would not be accurate, as int
storage is platform dependent. char is 1 bytes mostly.p[b]
is equivalent to *(p+b) and already p=a has been set.
though result is coming for -1000,-1000, not sure what it
means physically(address of -2000 ?)

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How main function is called in c?

1169


What are the types of functions in c?

1039


If jack lies on Mon, Tue Wed and jill lies on Thursday, Friday and Saturday. If both together tell they lied yesterday. So c the given options and then c cos in the given dates one will be saying the truth and one will be lying. I got Thursday as option because jack is saying the truth he lied yest but jill is lying again as he lies on that day.

2322


What is the difference between the expression “++a” and “a++”?

1275


What does stand for?

1143


Is there any algorithm to search a string in link list in the minimum time?(please do not suggest the usual method of traversing the link list)

2342


hi send me sample aptitude papers of cts?

2222


What are pointers really good for, anyway?

1117


4-Take two sets of 5 numbers from user in two arrays. Sort array 1 in ascending and array 2 in descending order. Perform sorting by passing array to a function mySort(array, sortingOrder). Then multiply both the arrays returned from function, using metric multiplication technique in main. Print result in metric format.

2244


What is the explanation for modular programming?

1276


What is 2 d array in c?

1090


What is the difference between text and binary modes?

1243


What are the 5 organizational structures?

1084


What is extern c used for?

1120


Write a program to input the price of 1 burger and the number of burgers eaten by a group of friends .print the total amount to be paid by the group?

1101