Can you explain how its working? On Wed, Jul 13, 2011 at 1:58 PM, Anika Jain <[email protected]> wrote: > a better idea is use this: > > int a=9,b=4; > int sum=printf("%*s%*s",a,"",b,""); > printf("%d\n",sum); > > > On Wed, Jul 13, 2011 at 1:52 PM, nicks <[email protected]> wrote: >> >> if someone has better idea...then please suggest that..... >> plz explain how this is calculating sum -->> sum= (int)&p[b]; >> >> On Wed, Jul 13, 2011 at 1:50 PM, nicks <[email protected]> wrote: >>> >>> I am looking for a code which can add without using + sign >>> i searched the net and found the following code......can anyone explain >>> me whats happening in this ?? >>> >>> #include<stdio.h> >>> #include<conio.h> >>> int main() >>> { >>> int a=3000,b=20,sum; >>> char *p; >>> p=(char *)a; >>> sum= (int)&p[b]; //adding a & b >>> printf("Answer is :"); >>> printf("%d",sum); >>> return 0; >>> } >> >> -- >> 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. >
-- Dinesh Bansal The Law of Win says, "Let's not do it your way or my way; let's do it the best way." -- 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.
