What is the output of the following program? main( ) { int a = 10; if ((fork ( ) == 0)) a++; printf (“%d\n”, a ); }
What is the output of the following program? main( ) { int a = 10; if ((fork ( ) == 0)) a++; printf (“%d\n”, a ); } Correct Answer 10 and 11
fork is an operation using fork a process creates a copy of itself.
Here parent process will print 10 and child process will print 11.
মোঃ আরিফুল ইসলাম
Feb 20, 2025