This can be answer for addition for the question 2 numbers without
using + operator.
Interesting fact is that it works for -ve numbers also.actually it get
converted to unsigned and type converted back again to -ve number.
#include<stdio.h>
int main()
{
int a=-7,b=-2,s;
char *p;
p=(char *)a;
s= (int)&p[b]; //adding a & b //////HOW????
printf("sum=%d\n",s);
return 0;
}
output:
sum=-9
On 6/20/10, anand verma <[email protected]> wrote:
> thanks
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>
>
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/algogeeks?hl=en.