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
What is header file in c?
Write a C program on Centralized OLTP, Decentralized OLTP using locking mechanism, Semaphore using locking mechanism, Shared memory, message queues, channel of communication, sockets and a simple program on Saving bank application program using OLTP in IPC?
Multiply an Integer Number by 2 Without Using Multiplication Operator
How many bytes is a struct in c?
Why does everyone say not to use gets?
the number of measuring units from a arbitrary starting point in a record area or control block to some other point a) branching b) recording pointer c) none d) offset
Explain how can I read and write comma-delimited text?
What are the string functions? List some string functions available in c.
Why is c still so popular?
Explain how do you override a defined macro?
Using functions, write a program that multiplies two arrays. Use the following functions: - Function ReadArray - Function MultiplyArrays - Function DisplayArrays
When should the const modifier be used?
What is function prototype in c language?
What is signed and unsigned?
what are the advanced features of functions a) function declaration and prototypes b) calling functions by value or by reference c) recursion d) all the above