1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Annette [7]
3 years ago
10

Assuming that the actual process ids of the parent and child process are 2600 and 2650 respectively, what will be printed out at

lines A, B, C, D, E, and F? Be sure to explain your answers. int main() { pid_t x, y; int value = 90; value += 30; /* fork a child process */ x = fork(); if (x < 0) { /* error occurred */ fprintf(stderr,"Fork failed"); return(1); } else if (x == 0) { /* child process */ y = getpid(); printf("child: x = %d",x); /* A */ printf("child: y = %d",y); /* B */ value += 20; printf("child: value = %d\n", value); /* C */ exit(0); } else { /* parent process */ y= getpid(); printf("parent: x = %d",x); /* D */ printf("parent: y = %d",y); /* E */ wait(NULL); printf("parent: value = %d\n", value); /* F */ } }
Computers and Technology
1 answer:
VashaNatasha [74]3 years ago
4 0

Answer:

Output explanation to the given code can be defined as follows:

Explanation:

In A the output is 0 , It will return fork value of the child process that is 0. so, 0 is printed during child process.  

In B the output is 2650 , in which the getpid() method returns the child process id  value that is 2650.  

In C the output is 140, As it is declared in key, all process have their own "value" copies. 20 are inserted during childhood, so 140 are written.  

In D the output is 2650, its fork() method returns the child ID to the parent process. so the value 2650 is printed.  

In E the output is 2600, Its getpid() method will returns parent process id  that is equal to 2600.  

In F the output is 120 Since the value is declared in primary, all process so their own "value" copies. 120 will be printed during process.

You might be interested in
Difference between volatile and non volatile memory
slega [8]
<span>Volatile memory requires electricity or some kind of current to store information, and nonvolatile memory does not.</span>
6 0
3 years ago
Read 2 more answers
Bargain Bob's auto dealership sells vehicles. He sells Chrysler, Jeep, and Dodge brand vehicles. He tracks customer and manufact
marusya05 [52]

Answer:

Customer(1) - (1) Vehicle.

Explanation:

Cardinality is the mapping of entities or group of entities to a cardinal value. It tries to show the relationship between two objects like a cups in a shelf or plates in racks.

The car dealer in the question, sells one car to a customer and keep or prioritise the record of the main owner of the acquired vehicle. So the maximum cardinality assignment of the customer and vehicle is one (1) to one (1) mapping.

6 0
2 years ago
HELP PLEASE
atroni [7]

Answer: The role of a public relations manager is to keep the image of a celebrity, politician, ect. good so that they can keep their career going while constantly in the eye of the public. Public figures may find this useful because it can help them keep their record clean and have a personal life while also making it seem like they are perfect people to their audience, which in hand can help with business.

Explanation:

5 0
2 years ago
As the security administrator for your organization, you must be aware of all types of attacks that can occur and plan for them.
Aliun [14]

Answer:

The answer is "DDoS "

Explanation:

The distributed denial of service attack (DDoS) occurs whenever a directed program's wireless data or assets, generally one or even more application servers, were also swamped by various machines. This attack is always the consequence of many affected systems, that fill up the target network with traffic.

  • This attack is aimed to avoid legal customers of one's website from accessing it.  
  • In being effective in a DDoS attack, further demands need to be sent to the hacker than even the victim's server could deal with.  
  • One other way to successfully attack is to send fake requests from the attacker.
5 0
2 years ago
How many binary digits does a single hexadecimal digit represent?
Anna35 [415]
Four binary digits.  So letter D.


8 0
3 years ago
Other questions:
  • What are the two main components on the motherboard?
    12·2 answers
  • 14<br> Select the correct answer.<br> Which activity is a marketing technique?
    9·1 answer
  • Most Internet users access commercial websites, which have higher-quality information because of higher editing standards and th
    12·1 answer
  • Frank develops a questionnaire for his study on Internet dating. One of his questions asks, "How do you feel about Internet dati
    14·2 answers
  • 9.18 LAB: Exact change - methods Write a program with total change amount as an integer input that outputs the change using the
    11·1 answer
  • 1. Would it be possible for two people to have the same email address? Explain.
    9·2 answers
  • Please Helpppp Me User Interface Design ensures that the interface has elements that are easy to ________________. (Choose all t
    8·1 answer
  • Document accurately describes the differences between servers and computers and between local and wide area networks. Document p
    5·1 answer
  • The pinky finger on the right hand types _____.
    15·2 answers
  • Giusp minfg gấp vs ạ đáp án thôi nhé
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!