Advertisement

04.28.2008 at 09:54PM PDT, ID: 23361073
[x]
Attachment Details

control flow output question!!

Asked by dongyowlin in C Programming Language, Miscellaneous Programming

Hi!
I would greatly appreciate all the help i can get with figuring out the output of the following control flow program! Thanks a bunch! :)


#include "csapp.h"
int counter = 1;

int main()
{
      if (fork() == 0)
      {
            counter--;
            exit(0);
      }
      else
      {
            Wait(NULL);
            printf("counter = %d\n", ++counter);
      }
      exit(0);
}Start Free Trial
[+][-]04.28.2008 at 10:07PM PDT, ID: 21459795

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: C Programming Language, Miscellaneous Programming
Sign Up Now!
Solution Provided By: sunnycoder
Participating Experts: 3
Solution Grade: A
 
 
[+][-]04.28.2008 at 11:02PM PDT, ID: 21459955

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.28.2008 at 11:31PM PDT, ID: 21460021

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.29.2008 at 09:55AM PDT, ID: 21464003

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.29.2008 at 09:58AM PDT, ID: 21464024

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.29.2008 at 11:21AM PDT, ID: 21464725

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.29.2008 at 11:44AM PDT, ID: 21464882

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.29.2008 at 02:04PM PDT, ID: 21466182

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.29.2008 at 08:25PM PDT, ID: 21467882

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.29.2008 at 08:59PM PDT, ID: 21467991

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.29.2008 at 09:16PM PDT, ID: 21468034

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628