Re: [algogeeks] plz help

2011-09-22 Thread rohit jangid
got 45 on linux than tried with fflush(stdout) and got 9 which is correct . so I guess that both child and parent process getting the same buffer and thus resulting in more number of hello correct answer is 9 as already mentioned On Sep 21, 2011 7:57 PM, sush57 sushaant...@gmail.com wrote:

Re: [algogeeks] plz help

2011-09-21 Thread Saravana kumar
Hello will be printed 45 times... On Wed, Sep 21, 2011 at 7:57 PM, sush57 sushaant...@gmail.com wrote: main() { int tmp; for(i=0;i9;i++) { tmp=fork(); if(tmp0) break; printf(Hello); } }

Re: [algogeeks] plz help

2011-09-21 Thread Anil Arya
http://ideone.com/nkTVN On Wed, Sep 21, 2011 at 11:43 PM, Saravana kumar saravana@gmail.comwrote: Hello will be printed 45 times... On Wed, Sep 21, 2011 at 7:57 PM, sush57 sushaant...@gmail.com wrote: main() { int tmp; for(i=0;i9;i++) {

Re: [algogeeks] plz help

2011-09-21 Thread ravi maggon
Output Hello printed 10 times. Since form command spawns the process, so for every call their are two process created and since if process gets successfully created fork returns some positive no. which is the process id, so it will break the loop and finally only the 10 child processes will be

Re: [algogeeks] plz help

2011-09-21 Thread Rashmi Jain
@ravi can u plz explain how 10 processes are created..? shouldn't it be 9..?? On Thu, Sep 22, 2011 at 12:23 AM, ravi maggon maggonr...@gmail.com wrote: Output Hello printed 10 times. Since form command spawns the process, so for every call their are two process created and since if process

Re: [algogeeks] plz help

2011-09-21 Thread ravi maggon
ohh sorry, I thought it was i=9. Yes only 9 times Hello will be printed. On Thu, Sep 22, 2011 at 12:52 AM, Rashmi Jain rashmi.jain...@gmail.comwrote: @ravi can u plz explain how 10 processes are created..? shouldn't it be 9..?? On Thu, Sep 22, 2011 at 12:23 AM, ravi maggon

Re: [algogeeks] plz help

2011-09-21 Thread Rashmi Jain
@ravi: thanks..!! On Thu, Sep 22, 2011 at 12:54 AM, ravi maggon maggonr...@gmail.com wrote: ohh sorry, I thought it was i=9. Yes only 9 times Hello will be printed. On Thu, Sep 22, 2011 at 12:52 AM, Rashmi Jain rashmi.jain...@gmail.comwrote: @ravi can u plz explain how 10 processes are

Re: [algogeeks] plz help

2011-09-21 Thread teja bala
@ ravi but compile it on http://ideone.com/nkTVN it showing 45 hello plz do look at it... On Thu, Sep 22, 2011 at 12:59 AM, Rashmi Jain rashmi.jain...@gmail.comwrote: @ravi: thanks..!! On Thu, Sep 22, 2011 at 12:54 AM, ravi maggon maggonr...@gmail.comwrote: ohh sorry, I thought it was

Re: [algogeeks] plz help

2011-09-21 Thread ravi maggon
This is the output I am getting - result: Success time: 0smemory: 1720 kB returned value: 0 input: no output: HelloHelloHelloHelloHelloHelloHelloHelloHelloHello On Thu, Sep 22, 2011 at 1:40 AM, teja bala pawanjalsa.t...@gmail.comwrote: @ ravi but compile it on

Re: [algogeeks] plz help

2011-09-21 Thread Rashmi Jain
but in this output 10 times hello is printed..how..?? On Thu, Sep 22, 2011 at 1:52 AM, ravi maggon maggonr...@gmail.com wrote: This is the output I am getting - result: Success time: 0smemory: 1720 kB returned value: 0 input: no output:

Re: [algogeeks] plz help for C output

2011-09-10 Thread abhinav gupta
a) 100 On Sat, Sep 10, 2011 at 12:40 AM, abhishek abhishek.ma...@gmail.com wrote: (a) #define f(g,g2) g##g2 int main() { int var12=100; printf(%d,f(var,12)); getch(); } what will be the output?? (b) main() { int i=400,j-300; printf(%d...%d); } (c) void main() {

Re: [algogeeks] plz help for C output

2011-09-10 Thread parag khanna
1. 100 2. 400...300 3. 4 .. 2 -- Parag Khanna B.tech Final Year NIT,Kurukshetra -- 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

Re: [algogeeks] plz help for C output

2011-09-10 Thread bharatkumar bagana
2nd answer is compiler dependent ..i think so .. in gcc it gives garbage values . On Sat, Sep 10, 2011 at 3:51 AM, parag khanna khanna.para...@gmail.comwrote: 1. 100 2. 400...300 3. 4 .. 2 -- Parag Khanna B.tech Final Year NIT,Kurukshetra -- You received this message

Re: [algogeeks] plz help for C output

2011-09-10 Thread Sajal Choudhary
in #definef(g,g2) g##g2 the ## operator concatenate the 2 arguments in the macro expansion. thus it becomes var12 -- Sajal Choudhary Undergraduate Student, Division of Computer Engineering, Netaji Subhas Institute of Technology, New Delhi. -- You received this message because you are

Re: [algogeeks] plz help

2011-09-07 Thread rahul vatsa
i think it should be 1. 5/2 paintings r made by 5/2 ppl in 5/2 days using 5/2 canvas = 1 painting is made by 1 person in 1 day using 1 canvas i.e. 1 guy cn make a painting in 1 day using a canvas. Now, the other case, to make 25 paintings using 25 canvases in 25 days. As there r 25 days total

Re: [algogeeks] plz help with this

2011-08-02 Thread durgaprasad k
I think the code is running infinity times as there is no checking condition when to stop the calculation of max value. so before going to the max function there should be a checking till when you need to run the loop. Regards, Durga On Tue, Aug 2, 2011 at 2:30 PM, Gayathri Anandan

Re: [algogeeks] plz help with this

2011-08-02 Thread Prem Krishna Chettri
Well This is Certainly lacks logic behind the Coder. Please remember EVERY RECURSIVE PROGRAM Need Break for certain condition. here mid keep updating without knowing when to finish the recursion so the code never goes below line seven.. I appreciate this way of Creating LOOP although its a

Re: [algogeeks] Plz help with multidimensional array

2010-07-07 Thread sharad kumar
@ashish cant u make use of char *p[30] for 2 d array On Wed, Jul 7, 2010 at 9:34 AM, Ashish Goel ashg...@gmail.com wrote: char name[][10] is a auto variable on stack, so no pointers here Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652

Re: [algogeeks] Plz help with multidimensional array

2010-07-06 Thread Ashish Goel
char name[][10] is a auto variable on stack, so no pointers here Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 On Wed, Jul 7, 2010 at 9:10 AM, UMESH KUMAR kumar.umesh...@gmail.comwrote: char name[][10]={jan,feb,march}; Name is a 2-D