Re: [algogeeks] help with o/p why 0 comes???

2013-02-28 Thread gmagog...@gmail.com
I think this is because of type mismatch. You are enforcing your program to read a floating point number in the way of reading a integer. And they have totally different format. If you have -Wall turned on, you should see a warning. Yanan Cao On Thu, Feb 28, 2013 at 1:41 PM, Shubham Sandeep

Re: [algogeeks] Re:

2012-08-21 Thread gmagog...@gmail.com
@dave Nice explanation! Yanan Cao On Tue, Aug 21, 2012 at 10:32 AM, Dave dave_and_da...@juno.com wrote: @Wladimirufc: You responded that the type is int. This data type (usually) is 32 bits in length, and stores integers in the twos-complement number system. See

Re: [algogeeks] C concept on memory layout

2012-02-06 Thread gmagog...@gmail.com
I think you are right about p being in BSS segment and it does last even the function finishes, however, you may need a pointer to get the data out of p. Then you can read the data. Correct me if i am wrong On Mon, Feb 6, 2012 at 1:04 PM, Ravi Ranjan ravi.cool2...@gmail.com wrote: i have a

Re: [algogeeks] Re: Aps

2011-09-07 Thread gmagog...@gmail.com
lmao Yanan Cao On Wed, Sep 7, 2011 at 10:14 AM, Don dondod...@gmail.com wrote: Clearly you are sitting still looking at a Route 66 sign. Don On Sep 7, 10:09 am, Mani Bharathi manibharat...@gmail.com wrote: While traveling at uniform speed. U read a two digit no. after one hr the

Re: [algogeeks] MS written test

2011-09-07 Thread gmagog...@gmail.com
0xa == 0x 1010, which stands for all the even bits 0x5 == 0x 0101, which stands for all the odd bits 1 and 1 means shifting odd to even and even to odd then | means putting new even bits and odd bits together Yanan Cao On Wed, Sep 7, 2011 at 10:23 AM, teja bala

Re: [algogeeks] apti!

2011-08-26 Thread gmagog...@gmail.com
20? Yanan Cao On Fri, Aug 26, 2011 at 1:12 PM, priya ramesh love.for.programm...@gmail.com wrote: A certain number of men can finish a piece of work in 10 days. If however there were 10 men less it will take 10 days more for the work to be finished. How many men were there originally?

Re: [algogeeks] apti!

2011-08-26 Thread gmagog...@gmail.com
@Rahul Assume the productivity of each man is the same let original number of man be x The total workload= x*10*p also workload = (x-10)(10+10)*p solve it so x=20 Yanan Cao On Fri, Aug 26, 2011 at 1:21 PM, Rahul Verma rahul08k...@gmail.com wrote: @yanan how it is 20. Rahul Verma --

Re: [algogeeks] C output

2011-08-22 Thread gmagog...@gmail.com
output is 10 using gcc 4.5.2 Yanan Cao On Mon, Aug 22, 2011 at 2:18 PM, sagar pareek sagarpar...@gmail.com wrote: Yeah its o/p is 10 :) On Tue, Aug 23, 2011 at 12:45 AM, Deepak Garg deepakgarg...@gmail.comwrote: its output is 10 On Tue, Aug 23, 2011 at 12:03 AM, rohit

Re: [algogeeks] Re: question on fork()

2011-08-22 Thread gmagog...@gmail.com
I am getting 6 red and 8 green as expected using the original code Yanan Cao On Mon, Aug 22, 2011 at 2:38 PM, Yasir yasir@gmail.com wrote: Surprisingly, if I comment the last if condition ( which is AFTER red() call ), it is printing red only 6 times as expected..

Re: [algogeeks] Re: question on fork()

2011-08-22 Thread gmagog...@gmail.com
Infinite times Yanan Cao On Mon, Aug 22, 2011 at 2:43 PM, Don dondod...@gmail.com wrote: // DO NOT RUN THIS! By inspection, how many times will it print Hello world? // If you find out by running it, that is cheating. Don't do it! int main() { int i=0, j=0; for(i = 0; i*j 20; ++i)

Re: [algogeeks] novel written test

2011-06-27 Thread gmagog...@gmail.com
Is it required that no two sons have the same age? From my view, the clue my youngest is the youngest only defines the requirement that the youngest one is unique, but he can still have two older brothers of the same age. Please correct me if this is wrong. Yanan Cao On Mon, Jun 27, 2011 at

Re: [algogeeks] novel written test

2011-06-27 Thread gmagog...@gmail.com
if( links can be melt and made into smaller links ) { return 1; } else { return 2; } Yanan Cao On Mon, Jun 27, 2011 at 4:09 PM, sourabh jakhar sourabhjak...@gmail.comwrote: two On Tue, Jun 28, 2011 at 2:23 AM, amit the cool amitthecoo...@gmail.comwrote: A chain is broken into

Re: [algogeeks] [brain teaser ] 18march

2011-03-18 Thread gmagog...@gmail.com
and Yanan Cao On Fri, Mar 18, 2011 at 1:00 PM, anuj maurice anuj.maur...@gmail.comwrote: agree On Fri, Mar 18, 2011 at 10:05 PM, Kunal Patil kp101...@gmail.com wrote: Nothing !!! :P :P On Fri, Mar 18, 2011 at 1:02 PM, Lavesh Rawat lavesh.ra...@gmail.comwrote: *A Riddle Problem

Re: [algogeeks] How to print numbers from 1 to 100 without loop , without recursion , without #define statements , without goto statement

2011-03-16 Thread gmagog...@gmail.com
printf(1 2 3 4 5 6 7 8 9 10 11 12 13...); no loop, no recursion, no define, no goto. HAHA : ) On Wed, Mar 16, 2011 at 12:30 PM, Carl Barton odysseus.ulys...@gmail.comwrote: @kumar Your example is still recursion On 16 March 2011 16:46, kumar anurag anurag.it.jo...@gmail.com