SlideShare a Scribd company logo
1 of 1
Download to read offline
What is the exact output of the following code?
#include
#include
main()
{
int i,j;
i=fork();
for (j=0; j<3; j++)
{
if (i == 0 && j == 0)
{
sleep(3);
printf("Cats ");
}
else if (i == 0)
{
sleep(2);
printf("Dogs ");
}
else
{
sleep(2);
printf("Raining ");
}
}
}
Solution
Answer for the above code is as follows:
Status : runtime error
Output:
Raining
Raining
Raining

More Related Content

More from armyshoes

Define the following engineering terms1. engineering ethics2. W.pdf
Define the following engineering terms1. engineering ethics2. W.pdfDefine the following engineering terms1. engineering ethics2. W.pdf
Define the following engineering terms1. engineering ethics2. W.pdf
armyshoes
 
Data structuresUsing java language and develop a prot.pdf
Data structuresUsing java language and develop a prot.pdfData structuresUsing java language and develop a prot.pdf
Data structuresUsing java language and develop a prot.pdf
armyshoes
 
You have been cut! While you wage war in the streets of Gotham for y.pdf
You have been cut! While you wage war in the streets of Gotham for y.pdfYou have been cut! While you wage war in the streets of Gotham for y.pdf
You have been cut! While you wage war in the streets of Gotham for y.pdf
armyshoes
 
what is the value of nursing educationSolutionThe main value o.pdf
what is the value of nursing educationSolutionThe main value o.pdfwhat is the value of nursing educationSolutionThe main value o.pdf
what is the value of nursing educationSolutionThe main value o.pdf
armyshoes
 
Tetrad AnalysisYou should be able to explain and you should know e.pdf
Tetrad AnalysisYou should be able to explain and you should know e.pdfTetrad AnalysisYou should be able to explain and you should know e.pdf
Tetrad AnalysisYou should be able to explain and you should know e.pdf
armyshoes
 
please help with this genetics problem You have 3 Serratia strains (.pdf
please help with this genetics problem You have 3 Serratia strains (.pdfplease help with this genetics problem You have 3 Serratia strains (.pdf
please help with this genetics problem You have 3 Serratia strains (.pdf
armyshoes
 
Please briefly describe Two types of statics where you will NOT o.pdf
Please briefly describe Two types of statics where you will NOT o.pdfPlease briefly describe Two types of statics where you will NOT o.pdf
Please briefly describe Two types of statics where you will NOT o.pdf
armyshoes
 
Northwest Bakery produces seven types of loaf bread and distributes .pdf
Northwest Bakery produces seven types of loaf bread and distributes .pdfNorthwest Bakery produces seven types of loaf bread and distributes .pdf
Northwest Bakery produces seven types of loaf bread and distributes .pdf
armyshoes
 

More from armyshoes (20)

Define the following engineering terms1. engineering ethics2. W.pdf
Define the following engineering terms1. engineering ethics2. W.pdfDefine the following engineering terms1. engineering ethics2. W.pdf
Define the following engineering terms1. engineering ethics2. W.pdf
 
Data structuresUsing java language and develop a prot.pdf
Data structuresUsing java language and develop a prot.pdfData structuresUsing java language and develop a prot.pdf
Data structuresUsing java language and develop a prot.pdf
 
You have been cut! While you wage war in the streets of Gotham for y.pdf
You have been cut! While you wage war in the streets of Gotham for y.pdfYou have been cut! While you wage war in the streets of Gotham for y.pdf
You have been cut! While you wage war in the streets of Gotham for y.pdf
 
Why has Mexico encountered such a significant collapse from an econom.pdf
Why has Mexico encountered such a significant collapse from an econom.pdfWhy has Mexico encountered such a significant collapse from an econom.pdf
Why has Mexico encountered such a significant collapse from an econom.pdf
 
Which of the following isare true of BOTH natural selection and gen.pdf
Which of the following isare true of BOTH natural selection and gen.pdfWhich of the following isare true of BOTH natural selection and gen.pdf
Which of the following isare true of BOTH natural selection and gen.pdf
 
Which of the following information-management systems uses artificia.pdf
Which of the following information-management systems uses artificia.pdfWhich of the following information-management systems uses artificia.pdf
Which of the following information-management systems uses artificia.pdf
 
What steps and tools are used for Pen TestingSolutionSteps fo.pdf
What steps and tools are used for Pen TestingSolutionSteps fo.pdfWhat steps and tools are used for Pen TestingSolutionSteps fo.pdf
What steps and tools are used for Pen TestingSolutionSteps fo.pdf
 
which event in this life cycle is comparable to fertilizarion .pdf
which event in this life cycle is comparable to fertilizarion .pdfwhich event in this life cycle is comparable to fertilizarion .pdf
which event in this life cycle is comparable to fertilizarion .pdf
 
what is the value of nursing educationSolutionThe main value o.pdf
what is the value of nursing educationSolutionThe main value o.pdfwhat is the value of nursing educationSolutionThe main value o.pdf
what is the value of nursing educationSolutionThe main value o.pdf
 
Using a Fabry-Perot interferometer, we can Observe small objects. D.pdf
Using a Fabry-Perot interferometer, we can  Observe small objects.  D.pdfUsing a Fabry-Perot interferometer, we can  Observe small objects.  D.pdf
Using a Fabry-Perot interferometer, we can Observe small objects. D.pdf
 
TRUE of falseA researcher found 95 confident interval for the aver.pdf
TRUE of falseA researcher found 95 confident interval for the aver.pdfTRUE of falseA researcher found 95 confident interval for the aver.pdf
TRUE of falseA researcher found 95 confident interval for the aver.pdf
 
The major type of interactive forces between molecules of HCl are i.pdf
The major type of interactive forces between molecules of HCl are  i.pdfThe major type of interactive forces between molecules of HCl are  i.pdf
The major type of interactive forces between molecules of HCl are i.pdf
 
Tetrad AnalysisYou should be able to explain and you should know e.pdf
Tetrad AnalysisYou should be able to explain and you should know e.pdfTetrad AnalysisYou should be able to explain and you should know e.pdf
Tetrad AnalysisYou should be able to explain and you should know e.pdf
 
Security ImplicationsWhat are the implications of Shannon’s work o.pdf
Security ImplicationsWhat are the implications of Shannon’s work o.pdfSecurity ImplicationsWhat are the implications of Shannon’s work o.pdf
Security ImplicationsWhat are the implications of Shannon’s work o.pdf
 
Protect tissues Spinal cord functions to includes pituitary gland ski.pdf
Protect tissues Spinal cord functions to includes pituitary gland ski.pdfProtect tissues Spinal cord functions to includes pituitary gland ski.pdf
Protect tissues Spinal cord functions to includes pituitary gland ski.pdf
 
Present and explain each step in human perception process. To what e.pdf
Present and explain each step in human perception process. To what e.pdfPresent and explain each step in human perception process. To what e.pdf
Present and explain each step in human perception process. To what e.pdf
 
please help with this genetics problem You have 3 Serratia strains (.pdf
please help with this genetics problem You have 3 Serratia strains (.pdfplease help with this genetics problem You have 3 Serratia strains (.pdf
please help with this genetics problem You have 3 Serratia strains (.pdf
 
Please briefly describe Two types of statics where you will NOT o.pdf
Please briefly describe Two types of statics where you will NOT o.pdfPlease briefly describe Two types of statics where you will NOT o.pdf
Please briefly describe Two types of statics where you will NOT o.pdf
 
Northwest Bakery produces seven types of loaf bread and distributes .pdf
Northwest Bakery produces seven types of loaf bread and distributes .pdfNorthwest Bakery produces seven types of loaf bread and distributes .pdf
Northwest Bakery produces seven types of loaf bread and distributes .pdf
 
Interface four common anode seven-segment LEDs to the PIC18F452 micr.pdf
Interface four common anode seven-segment LEDs to the PIC18F452 micr.pdfInterface four common anode seven-segment LEDs to the PIC18F452 micr.pdf
Interface four common anode seven-segment LEDs to the PIC18F452 micr.pdf
 

Recently uploaded

1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
QucHHunhnh
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
QucHHunhnh
 
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdfVishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
ssuserdda66b
 

Recently uploaded (20)

1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdfVishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 

What is the exact output of the following code#include stdio.h.pdf

  • 1. What is the exact output of the following code? #include #include main() { int i,j; i=fork(); for (j=0; j<3; j++) { if (i == 0 && j == 0) { sleep(3); printf("Cats "); } else if (i == 0) { sleep(2); printf("Dogs "); } else { sleep(2); printf("Raining "); } } } Solution Answer for the above code is as follows: Status : runtime error Output: Raining Raining Raining