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

Why do we use return in c?

559


What is c language & why it is used?

568


List the difference between a "copy constructor" and a "assignment operator"?

573


Do you have any idea about the use of "auto" keyword?

655


What is the use of #define preprocessor in c?

606






What are the basic data types associated with c?

803


What is void main ()?

603


What is printf () in c?

573


A text file that contains declarations used by a group of functions,programs,or users a) executable file b) header file c) obj file d) .cfile

634


How do you define CONSTANT in C?

642


How do you print only part of a string?

602


What is the use of typedef in c?

574


write a program in C that prompts the user for today's date,tomorrow's date and display the results.Use structures for today's date,tomorrow's date and an array to hold the days for each month of the year.

4972


Who developed c language?

630


What is the advantage of c?

604