SlideShare a Scribd company logo
1 of 2
Consider the following valid C program:
Which process(es) print(s) out the magic word, XYZZY? Choose one of the following:
1. Both the parent and child processes
Solution
/* #include statements */
main()
{
pid_t spawnpid = fork();Â Â //Creates a new process with the fork(), and the return value is
assigned to spawnpid.
//The fork returns a negative value, if the child process creation fails.
//The fork returns a positive value, if the child process creation is successful.
//The fork returns a zero, to the child process.
//If the process creation is successful, all the instructions from hereafter will be executed by both
the processes.
switch (spawnpid)
{
case -1: exit(1); break;Â Â //The parent process spawnpid is a positive value, and the child
process spawnpid is 0.
case 0: exit(0); break;Â Â //The child process spawnpid is 0, and therefore, will exit at this
point.
default: break;Â Â Â Â Â Â Â Â //The parent process spawnpid is neither negative nor zero,
so this will come out of the switch.
}
printf("XYZZY ");Â Â Â Â Â Â Â Â //Therefore, the parent process executes this statement,
after coming out of the switch.
}
And therefore, the answer is: 3. The parent process.
Consider the following valid C program- Which process(es) print(s) out.docx

More Related Content

Similar to Consider the following valid C program- Which process(es) print(s) out.docx

Introduction To Programming IP5
Introduction To Programming IP5Introduction To Programming IP5
Introduction To Programming IP5Mark Simon
 
public class Point {   Insert your name here    private dou.pdf
public class Point {    Insert your name here    private dou.pdfpublic class Point {    Insert your name here    private dou.pdf
public class Point {   Insert your name here    private dou.pdfanandshingavi23
 
Programming Assignment #2CSci 430 Spring 2019Dates.docx
Programming Assignment #2CSci 430 Spring 2019Dates.docxProgramming Assignment #2CSci 430 Spring 2019Dates.docx
Programming Assignment #2CSci 430 Spring 2019Dates.docxstilliegeorgiana
 
Programming Assignment #2CSci 430 Spring 2019Dates.docx
Programming Assignment #2CSci 430 Spring 2019Dates.docxProgramming Assignment #2CSci 430 Spring 2019Dates.docx
Programming Assignment #2CSci 430 Spring 2019Dates.docxdenneymargareta
 
SystemVerilog OOP Ovm Features Summary
SystemVerilog OOP Ovm Features SummarySystemVerilog OOP Ovm Features Summary
SystemVerilog OOP Ovm Features SummaryAmal Khailtash
 
Fuzail_File_C.docx
Fuzail_File_C.docxFuzail_File_C.docx
Fuzail_File_C.docxSyedFuzail14
 
Single Sourcing RAP and RCP - Desktop and web clients from a single code base
Single Sourcing RAP and RCP - Desktop and web clients from a single code baseSingle Sourcing RAP and RCP - Desktop and web clients from a single code base
Single Sourcing RAP and RCP - Desktop and web clients from a single code baseRalf Sternberg
 
Unit 5
Unit 5Unit 5
Unit 5siddr
 
12 lec 12 loop
12 lec 12 loop 12 lec 12 loop
12 lec 12 loop kapil078
 
ood evening people. Ive been working on this code that sends a bur.pdf
ood evening people. Ive been working on this code that sends a bur.pdfood evening people. Ive been working on this code that sends a bur.pdf
ood evening people. Ive been working on this code that sends a bur.pdfaroramobiles1
 
Bti1022 lab sheet 7
Bti1022 lab sheet 7Bti1022 lab sheet 7
Bti1022 lab sheet 7alish sha
 

Similar to Consider the following valid C program- Which process(es) print(s) out.docx (20)

Week2 ch4 part1edited 2020
Week2 ch4 part1edited 2020Week2 ch4 part1edited 2020
Week2 ch4 part1edited 2020
 
Week2 ch4 part1edited 2020
Week2 ch4 part1edited 2020Week2 ch4 part1edited 2020
Week2 ch4 part1edited 2020
 
Introduction To Programming IP5
Introduction To Programming IP5Introduction To Programming IP5
Introduction To Programming IP5
 
public class Point {   Insert your name here    private dou.pdf
public class Point {    Insert your name here    private dou.pdfpublic class Point {    Insert your name here    private dou.pdf
public class Point {   Insert your name here    private dou.pdf
 
Programming Assignment #2CSci 430 Spring 2019Dates.docx
Programming Assignment #2CSci 430 Spring 2019Dates.docxProgramming Assignment #2CSci 430 Spring 2019Dates.docx
Programming Assignment #2CSci 430 Spring 2019Dates.docx
 
Programming Assignment #2CSci 430 Spring 2019Dates.docx
Programming Assignment #2CSci 430 Spring 2019Dates.docxProgramming Assignment #2CSci 430 Spring 2019Dates.docx
Programming Assignment #2CSci 430 Spring 2019Dates.docx
 
Ipc
IpcIpc
Ipc
 
SystemVerilog OOP Ovm Features Summary
SystemVerilog OOP Ovm Features SummarySystemVerilog OOP Ovm Features Summary
SystemVerilog OOP Ovm Features Summary
 
Fuzail_File_C.docx
Fuzail_File_C.docxFuzail_File_C.docx
Fuzail_File_C.docx
 
Presentation1
Presentation1Presentation1
Presentation1
 
Single Sourcing RAP and RCP - Desktop and web clients from a single code base
Single Sourcing RAP and RCP - Desktop and web clients from a single code baseSingle Sourcing RAP and RCP - Desktop and web clients from a single code base
Single Sourcing RAP and RCP - Desktop and web clients from a single code base
 
Unit 5
Unit 5Unit 5
Unit 5
 
C-LOOP-Session-2.pptx
C-LOOP-Session-2.pptxC-LOOP-Session-2.pptx
C-LOOP-Session-2.pptx
 
process creation OS
process creation OSprocess creation OS
process creation OS
 
Hargun
HargunHargun
Hargun
 
Os lab final
Os lab finalOs lab final
Os lab final
 
12 lec 12 loop
12 lec 12 loop 12 lec 12 loop
12 lec 12 loop
 
ood evening people. Ive been working on this code that sends a bur.pdf
ood evening people. Ive been working on this code that sends a bur.pdfood evening people. Ive been working on this code that sends a bur.pdf
ood evening people. Ive been working on this code that sends a bur.pdf
 
BLM101_2.pptx
BLM101_2.pptxBLM101_2.pptx
BLM101_2.pptx
 
Bti1022 lab sheet 7
Bti1022 lab sheet 7Bti1022 lab sheet 7
Bti1022 lab sheet 7
 

More from kaseya1

A number of monks live in a monastery and they do not communicate in a.docx
A number of monks live in a monastery and they do not communicate in a.docxA number of monks live in a monastery and they do not communicate in a.docx
A number of monks live in a monastery and they do not communicate in a.docxkaseya1
 
A molecule or ion that donates the hydrogen in a hydrogen bond is a hy (1).docx
A molecule or ion that donates the hydrogen in a hydrogen bond is a hy (1).docxA molecule or ion that donates the hydrogen in a hydrogen bond is a hy (1).docx
A molecule or ion that donates the hydrogen in a hydrogen bond is a hy (1).docxkaseya1
 
A person talking produces a sound level of 65 dB at a distance of 50 c.docx
A person talking produces a sound level of 65 dB at a distance of 50 c.docxA person talking produces a sound level of 65 dB at a distance of 50 c.docx
A person talking produces a sound level of 65 dB at a distance of 50 c.docxkaseya1
 
A metal plate is illuminated with light of a certain frequency- Which.docx
A metal plate is illuminated with light of a certain frequency- Which.docxA metal plate is illuminated with light of a certain frequency- Which.docx
A metal plate is illuminated with light of a certain frequency- Which.docxkaseya1
 
A Martian leaves Mars in a spaceship that is heading to Venus- On the.docx
A Martian leaves Mars in a spaceship that is heading to Venus- On the.docxA Martian leaves Mars in a spaceship that is heading to Venus- On the.docx
A Martian leaves Mars in a spaceship that is heading to Venus- On the.docxkaseya1
 
a major change in our study of differing economic systems in the era o.docx
a major change in our study of differing economic systems in the era o.docxa major change in our study of differing economic systems in the era o.docx
a major change in our study of differing economic systems in the era o.docxkaseya1
 
A leadership-motivation case is provided below- The case includes impo.docx
A leadership-motivation case is provided below- The case includes impo.docxA leadership-motivation case is provided below- The case includes impo.docx
A leadership-motivation case is provided below- The case includes impo.docxkaseya1
 
A kettle is filled with tap water and placed on a stove- The stove ele.docx
A kettle is filled with tap water and placed on a stove- The stove ele.docxA kettle is filled with tap water and placed on a stove- The stove ele.docx
A kettle is filled with tap water and placed on a stove- The stove ele.docxkaseya1
 
A photographer works part-time in a shopping center- 2 hours per day-.docx
A photographer works part-time in a shopping center- 2 hours per day-.docxA photographer works part-time in a shopping center- 2 hours per day-.docx
A photographer works part-time in a shopping center- 2 hours per day-.docxkaseya1
 
Consider the following definitions for linked lists for problems 6 thr.docx
Consider the following definitions for linked lists for problems 6 thr.docxConsider the following definitions for linked lists for problems 6 thr.docx
Consider the following definitions for linked lists for problems 6 thr.docxkaseya1
 
Consider the following chemical compounds- Classify each as either an.docx
Consider the following chemical compounds- Classify each as either an.docxConsider the following chemical compounds- Classify each as either an.docx
Consider the following chemical compounds- Classify each as either an.docxkaseya1
 
Consider the plane R2 and consider any two lines that pass through the.docx
Consider the plane R2 and consider any two lines that pass through the.docxConsider the plane R2 and consider any two lines that pass through the.docx
Consider the plane R2 and consider any two lines that pass through the.docxkaseya1
 
Consider the following statements about the investment in working capi.docx
Consider the following statements about the investment in working capi.docxConsider the following statements about the investment in working capi.docx
Consider the following statements about the investment in working capi.docxkaseya1
 
Consider the following method definitions intended to find the smalles.docx
Consider the following method definitions intended to find the smalles.docxConsider the following method definitions intended to find the smalles.docx
Consider the following method definitions intended to find the smalles.docxkaseya1
 
Consider relations R and S as following and answer question- R A B 1 2 (8).docx
Consider relations R and S as following and answer question- R A B 1 2 (8).docxConsider relations R and S as following and answer question- R A B 1 2 (8).docx
Consider relations R and S as following and answer question- R A B 1 2 (8).docxkaseya1
 

More from kaseya1 (15)

A number of monks live in a monastery and they do not communicate in a.docx
A number of monks live in a monastery and they do not communicate in a.docxA number of monks live in a monastery and they do not communicate in a.docx
A number of monks live in a monastery and they do not communicate in a.docx
 
A molecule or ion that donates the hydrogen in a hydrogen bond is a hy (1).docx
A molecule or ion that donates the hydrogen in a hydrogen bond is a hy (1).docxA molecule or ion that donates the hydrogen in a hydrogen bond is a hy (1).docx
A molecule or ion that donates the hydrogen in a hydrogen bond is a hy (1).docx
 
A person talking produces a sound level of 65 dB at a distance of 50 c.docx
A person talking produces a sound level of 65 dB at a distance of 50 c.docxA person talking produces a sound level of 65 dB at a distance of 50 c.docx
A person talking produces a sound level of 65 dB at a distance of 50 c.docx
 
A metal plate is illuminated with light of a certain frequency- Which.docx
A metal plate is illuminated with light of a certain frequency- Which.docxA metal plate is illuminated with light of a certain frequency- Which.docx
A metal plate is illuminated with light of a certain frequency- Which.docx
 
A Martian leaves Mars in a spaceship that is heading to Venus- On the.docx
A Martian leaves Mars in a spaceship that is heading to Venus- On the.docxA Martian leaves Mars in a spaceship that is heading to Venus- On the.docx
A Martian leaves Mars in a spaceship that is heading to Venus- On the.docx
 
a major change in our study of differing economic systems in the era o.docx
a major change in our study of differing economic systems in the era o.docxa major change in our study of differing economic systems in the era o.docx
a major change in our study of differing economic systems in the era o.docx
 
A leadership-motivation case is provided below- The case includes impo.docx
A leadership-motivation case is provided below- The case includes impo.docxA leadership-motivation case is provided below- The case includes impo.docx
A leadership-motivation case is provided below- The case includes impo.docx
 
A kettle is filled with tap water and placed on a stove- The stove ele.docx
A kettle is filled with tap water and placed on a stove- The stove ele.docxA kettle is filled with tap water and placed on a stove- The stove ele.docx
A kettle is filled with tap water and placed on a stove- The stove ele.docx
 
A photographer works part-time in a shopping center- 2 hours per day-.docx
A photographer works part-time in a shopping center- 2 hours per day-.docxA photographer works part-time in a shopping center- 2 hours per day-.docx
A photographer works part-time in a shopping center- 2 hours per day-.docx
 
Consider the following definitions for linked lists for problems 6 thr.docx
Consider the following definitions for linked lists for problems 6 thr.docxConsider the following definitions for linked lists for problems 6 thr.docx
Consider the following definitions for linked lists for problems 6 thr.docx
 
Consider the following chemical compounds- Classify each as either an.docx
Consider the following chemical compounds- Classify each as either an.docxConsider the following chemical compounds- Classify each as either an.docx
Consider the following chemical compounds- Classify each as either an.docx
 
Consider the plane R2 and consider any two lines that pass through the.docx
Consider the plane R2 and consider any two lines that pass through the.docxConsider the plane R2 and consider any two lines that pass through the.docx
Consider the plane R2 and consider any two lines that pass through the.docx
 
Consider the following statements about the investment in working capi.docx
Consider the following statements about the investment in working capi.docxConsider the following statements about the investment in working capi.docx
Consider the following statements about the investment in working capi.docx
 
Consider the following method definitions intended to find the smalles.docx
Consider the following method definitions intended to find the smalles.docxConsider the following method definitions intended to find the smalles.docx
Consider the following method definitions intended to find the smalles.docx
 
Consider relations R and S as following and answer question- R A B 1 2 (8).docx
Consider relations R and S as following and answer question- R A B 1 2 (8).docxConsider relations R and S as following and answer question- R A B 1 2 (8).docx
Consider relations R and S as following and answer question- R A B 1 2 (8).docx
 

Recently uploaded

Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfUjwalaBharambe
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...JhezDiaz1
 
ENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomnelietumpap1
 
ROOT CAUSE ANALYSIS PowerPoint Presentation
ROOT CAUSE ANALYSIS PowerPoint PresentationROOT CAUSE ANALYSIS PowerPoint Presentation
ROOT CAUSE ANALYSIS PowerPoint PresentationAadityaSharma884161
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementmkooblal
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designMIPLM
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxDr.Ibrahim Hassaan
 
AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.arsicmarija21
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Celine George
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Mark Reed
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxEyham Joco
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 

Recently uploaded (20)

Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
Raw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptxRaw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptx
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
 
ENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choom
 
ROOT CAUSE ANALYSIS PowerPoint Presentation
ROOT CAUSE ANALYSIS PowerPoint PresentationROOT CAUSE ANALYSIS PowerPoint Presentation
ROOT CAUSE ANALYSIS PowerPoint Presentation
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of management
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-design
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptx
 
AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptx
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 

Consider the following valid C program- Which process(es) print(s) out.docx

  • 1. Consider the following valid C program: Which process(es) print(s) out the magic word, XYZZY? Choose one of the following: 1. Both the parent and child processes Solution /* #include statements */ main() { pid_t spawnpid = fork();Â Â //Creates a new process with the fork(), and the return value is assigned to spawnpid. //The fork returns a negative value, if the child process creation fails. //The fork returns a positive value, if the child process creation is successful. //The fork returns a zero, to the child process. //If the process creation is successful, all the instructions from hereafter will be executed by both the processes. switch (spawnpid) { case -1: exit(1); break;Â Â //The parent process spawnpid is a positive value, and the child process spawnpid is 0. case 0: exit(0); break;Â Â //The child process spawnpid is 0, and therefore, will exit at this point. default: break;Â Â Â Â Â Â Â Â //The parent process spawnpid is neither negative nor zero, so this will come out of the switch. } printf("XYZZY ");Â Â Â Â Â Â Â Â //Therefore, the parent process executes this statement, after coming out of the switch. } And therefore, the answer is: 3. The parent process.