Re: [algogeeks] Re: swap objects without temp variable

2012-11-04 Thread Ashok Varma
Try this: a = a + b - (b = a); //single line code to swap On Mon, Nov 5, 2012 at 4:53 AM, Dave wrote: > @Manish: Sure. > > a = a + b; > b = a - b; > a = a - b; > > In 2-s complement arithmetic, it works even if a + b overflows. > > Dave > > On Sunday, November 4, 2012 2:32:43 PM UTC-6, manish

[algogeeks] Make File

2012-11-04 Thread Ashok Varma
Friends, Please clarify this. What is a Make file ? & What is its use ? -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+

Re: [algogeeks] Re: C prog o/p

2012-10-16 Thread Ashok Varma
i - j is giving -3 as output. why is this so ? On Tue, Oct 16, 2012 at 11:18 PM, iwill wrote: > how to explain the output if instead of j-i we try to print i-j ? > > > On Saturday, October 13, 2012 3:36:49 PM UTC+5:30, bharat wrote: >> >> #include >> main() >> { >> int *i,*j; >> i=(int*)60; >>

Re: [algogeeks] C prog o/p

2012-10-13 Thread Ashok Varma
where right? > 0x11 = 3 in decimal format not 11 base 10. > > typecasting to (int*) needs an address right? > I mean > int b=10; > int * a=(int*)&b; > > > > On Sat, Oct 13, 2012 at 9:10 PM, Ashok Varma wrote: > >> This gives a clear explanation: >>

Re: [algogeeks] C prog o/p

2012-10-13 Thread Ashok Varma
This gives a clear explanation: #include main(){ int *i,*j; i=(int*)60; j=(int*)71; printf ("%p %p %d",i,j,j-i);} op: 0x3c 0x47 2 0x47 - 0x3c = 0x11 and hence j-1 = 2 (11/4 = 2, size of int = 4 bytes) On Sat, Oct 13, 20

Re: [algogeeks] Assembly Output ADOBE question

2012-10-13 Thread Ashok Varma
what does the stack initially hold ? On Sat, Oct 13, 2012 at 4:18 PM, Akshat Sapra wrote: > > DETERMINE THE OUTPUT R1,R2,R3 ARE THREE REGISTERS > > START :POP R1 > POP R2 > COMPARE R2,0 > JUMP_EQ DONE_Z > PUSH R2 > PUSH R1 > SUBTRATCT R2,1 > PUSH R2 > CALL START > POP R3 > POP R1 > POP R2 > MULT