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
Write a program to print factorial of given number using recursion?
Who is the founder of c language?
What is header file definition?
Where does the name "C" come from, anyway?
Can include files be nested? How many levels deep can include files be nested?
What would the following code segment printint k = 8;docout << "k = " << k << " ";while k++ < 5; a) 13 b) 5 c) 8 d) pointers
main(){char *str;scanf("%s",str);printf("%s",str); }The error in the above program is: a) Variable 'str' is not initialised b) Format control for a string is not %s c) Parameter to scanf is passed by value. It should be an address d) none
What is the use of bitwise operator?
What are the types of bitwise operator?
Why is it important to memset a variable, immediately after allocating memory to it ?
why use functions a) writing functions avoids rewriting the same code over and over b) using functions it becomes easier to write programs and keep track of what they are doing c) a & b d) none of the above
What is operator promotion?
Explain c preprocessor?
Can you apply link and association interchangeably?
What is the difference between constant pointer and constant variable?