What is the output of the following program

#include<stdio.h>
main()
{
int i=0;
fork();
printf("%d",i++);
fork();
printf("%d",i++);
fork();
wait();
}

Answer Posted / raghu

totally 8 processes...so each process will print 0 & 1
output: 0101010101010101

Is This Answer Correct ?    6 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

praagnovation

1778


What are the features of c language?

621


what is the height of tree if leaf node is at level 3. please explain

1602


Explain what is wrong with this program statement?

621


What is string constants?

661






What is .obj file in c?

648


Explain what are the standard predefined macros?

651


Explain how can I convert a string to a number?

643


What are lookup tables in c?

550


How to implement a packet in C

2398


Is main is a keyword in c?

610


Can we assign string to char pointer?

588


hw can we delete an internal node of binary search tree the internal node has child node..plz write progarm

1633


Do you know pointer in c?

591


What does the && operator do in a program code?

698