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 / sourisengupta
finally we will get 001111.
for the first fork() two 0 will be printed and for secoond
forkk four 1 will be printed.
| Is This Answer Correct ? | 4 Yes | 3 No |
Post New Answer View All Answers
What is the use of linkage in c language?
What is omp_num_threads?
Draw a diagram showing how the operating system relates to users, application programs, and the computer hardware ?
What is identifier in c?
How are structure passing and returning implemented?
Differentiate between the expression “++a” and “a++”?
Write the test cases for checking a variable having value in range -10.0 to +10.0?
write a C program: To search a file any word which starts with ?a?. If the word following this ?a? starts with a vowel.Then replace this ?a? with ?a? with ?an?. redirect with the output onto an output file.The source file and destination file are specified by the user int the command line.
How can I call system when parameters (filenames, etc.) Of the executed command arent known until run time?
Why is c so important?
What does %2f mean in c?
What is the value of c?
find the output? void r(int a[],int c, int n) { if(c>n) { a[c]=a[c]+c; r(a,++c,n); r(a,++c,n); } } int main() { int i,a[5]={0}; r(a,0,5); for(i=0;i<5;i++) printf("\n %d",a[i]); getch(); }
Explain how do you print an address?
What is the difference between a string and an array?