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

01 finally i will have 2

Is This Answer Correct ?    4 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do I send escape sequences to control a terminal or other device?

624


Can a program have two main functions?

581


What is define directive?

650


In c programming write a program that will print 10 multiples of 3 except 15,18,21 using looping

985


Explain what’s a signal? Explain what do I use signals for?

618






What do you mean by keywords in c?

640


What is a loop?

564


What are the 5 types of inheritance in c ++?

594


What is the difference between variable declaration and variable definition in c?

572


What are qualifiers?

623


find out largest elemant of diagonalmatrix

1655


What are the different types of C instructions?

688


What is difference between stdio h and conio h?

900


If a five digit number is input through the keyboard, write a program to print a new number by adding one to each of its digits.For example if the number that is input is 12391 then the output should be displayed as 23402

3257


What is sizeof int in c?

616