Computer AwarenessVery hardIBPS SO IT Officer

A program calls fork() three times in a row, with no conditions, and every call succeeds. How many processes exist in total, counting the original?

  1. A. 8
  2. B. 6
  3. C. 4
  4. D. 7

Correct answer: A. 8

Each fork doubles the running processes: 1 → 2 → 4 → 8. Seven of them are children; 6 comes from wrongly adding 2 per call.

हिंदी में

एक प्रोग्राम बिना किसी शर्त के लगातार तीन बार fork() कॉल करता है, और प्रत्येक कॉल सफल होती है। मूल प्रक्रिया सहित कुल कितनी प्रक्रियाएँ होंगी?

  1. A. 8
  2. B. 6
  3. C. 4
  4. D. 7

उत्तर: A. प्रत्येक fork चल रही प्रक्रियाओं को दोगुना करता है: 1 → 2 → 4 → 8। इनमें से सात चाइल्ड हैं; 6 गलती से प्रति कॉल 2 जोड़ने से आता है।

More Computer Awareness questions

Exams that ask this topic