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 / vignesh1988i
for first printf it will print 0, for second printf it will
print 1.. and finally i will have a value 2.
Is This Answer Correct ? | 5 Yes | 5 No |
Post New Answer View All Answers
What are the basic data types associated with c?
what will be maximum number of comparisons when number of elements are given?
Is there any demerits of using pointer?
Explain the properties of union.
What are the types of pointers in c?
What is difference between %d and %i in c?
what are the advantages of a macro over a function?
What is the use of f in c?
Differentiate fundamental data types and derived data types in C.
How can I handle floating-point exceptions gracefully?
Write programs for String Reversal & Palindrome check
1234554321 1234 4321 123 321 12 21 1 1 12 21 123 321 1234 4321 1234554321
Why array is used in c?
What are global variables and explain how do you declare them?
Tell us something about keyword 'auto'.