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:
main()
{
int tmp;
for(i=0;i9;i++)
{
tmp=fork();
if(tmp0)
break;
printf(Hello);
}
}
what's the output and how does this work
can u give few other questions using fork...
--
You received
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);
}
}
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++)
{
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
@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
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
@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
@ 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
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
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:
hello,
i want a good reference in web designing.can anyone plzz help me
with some good links, for reference..
plzz its urgent
Thanks in Advance
--
Tushar Kanta Rath,
Master In Computer Application
MNNIT, Allahabad
--
You received this message because you
(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()
{
char far *farther,* farthest ;
printf(%d..%d,sizeof(father),sizeof(farthest));
}
--
You received
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()
{
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
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
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
If 5/2 artists make 5/2 paintings using 5/2 canvases in 5/2 days then
how many artists r
required to make 25 paintings using 25 canvases in 25 days?
some sayin 25,some sayin 1...can anyone pls explain the answer
for this puzzle...
--
You received this message because you are subscribed
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
Guys american express coming to our college for training.
Plz anyone who has faced the written test and procedure.. please share
their views.. it wud be helpful for us..
thnks.
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to
I didnt get any output for this pgm. I think its keep on running and
got struck in the 6th line. Plz help with this.
1 #includestdio.h
2 #includeconio.h
3 int max(int a[10],int s,int e)
4 {
5 int res,res1,res2,mid=(s+e-1)/2;
6 res1=max(a,s,mid+1);
7 res2=max(a,mid+1,e);
8 res=res1res2?res1:res2;
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
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
@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
char name[3][10]={jan,feb,march};
name[0],name[1],name[2] are the elements of an array 'name'.
Can we think of name as an array of pointers where each pointer is of
type char (*p)[10]?
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to
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
26 matches
Mail list logo