Basic Computer Knowledge Test Questions and Answers

Linux Debugging Questions & Answers – fork, exec and wait System Calls

1.

What is the output of this program?

  1.    #include<stdio.h>
  2. 
     
  3.    int main()
  4.    {
  5.        fork();
  6.        printf("Sanfoundry\n");
  7.        return 0;
  8.    }

   A.) the string “Sanfoundry” will print 1 time
   B.) the string “Sanfoundry” will print 2 times
   C.) the string “Sanfoundry” will print 3 times
   D.) none of these

Answer: Option 'B'

the string “Sanfoundry” will print 2 times

Linux Debugging Questions & Answers – fork, exec and wait System Calls Download Pdf

Recent Posts