Re: [algogeeks] c question what is output?

2011-08-21 Thread Ayswarya Srinivasan
doesn it work like below ? func2(8)= 8 * func1(7) func1(7)= 7*6 so i=8*7*6??? On Sun, Aug 21, 2011 at 3:58 PM, Sanjay Rajpal srn...@gmail.com wrote: +1 to sagar Sanju :) On Sun, Aug 21, 2011 at 3:26 AM, sagar pareek sagarpar...@gmail.comwrote: FUNC2(i) = i==0?i*(i-1*(i-1-1))

Re: [algogeeks] GK-Q

2011-08-20 Thread Ayswarya Srinivasan
i guess the output is fff0 -1 = 0001 taking 1's complement 1110 taking 2's complement -14 left shifting 4 bits %x prints in hexa decimal format so o/p- f f f 0 On Sat, Aug 20, 2011 at 11:39 AM,

[algogeeks] ~ operator

2011-08-10 Thread Ayswarya Srinivasan
can someone explain how this works- * * *void* *main*(){ *int* a,b,d; scanf(%d%d,a,b); d=a+~b+1; printf(%d,d); getch(); } say if a=5 b=6 then output is -1 if ~ is one's complement operator then a=0101 ~b=1001 d= 0101+1001+1. which is not -1 can someone explain how it works.

Re: [algogeeks] Re: ~ operator

2011-08-10 Thread Ayswarya Srinivasan
thank you dave and amit... On Wed, Aug 10, 2011 at 8:36 PM, Dave dave_and_da...@juno.com wrote: @Ayswarya: In twos-complement arithmetic, -x = ~x + 1, so a + ~b + 1 = a +(~b +1) = a + (-b) = a - b. Dave On Aug 10, 9:23 am, Ayswarya Srinivasan krsayswa...@gmail.com wrote: can someone

Re: [algogeeks] Directi on campus

2011-08-03 Thread Ayswarya Srinivasan
the written consisted of 45 questions for 90 minutes.. negative marking was there.. the qs wer based on linux,networks, data structures and pattern matching problems.. some of the qs were.. 1. 25 horses, 5 race tracks, choose the top 3 . minimum number of races u need ? 2. 2 clocks A and B are