Poonam posted an Question
January 27, 2020 • 18:03 pm 30 points
  • UGC NET
  • Computer Science & Applications

OueS. Two functions P, & P, share B = 2 (initial value) P2 () P1 () C B1 B =2 C 3 4. D =2 * B B D 1. 2 The no. of distinct values of B after execution is B 2 B3

OueS. Two functions P, & P, share B = 2 (initial value) P2 () P1 () C B1 B =2 C 3 4. D =2 * B B D 1. 2 The no. of distinct values of B after execution is B 2 B3 B4 Sol. Execution sequence 1, 2, 3, 4 3, 4, 2. 1 1, 3, 2, 4 So, 3 values possible. lution to CSProblem

0 Answer(s) Answer Now
  • 0 Likes
  • 1 Comments
  • 0 Shares
  • comment-profile-img>
    Eduncle best-answer

    Dear Poonam,

    Greetings!!

    Ans.    (1)    
    Explanation: There are following ways that concurrent processes can follow.
        C = B – 1;   // C = 1
         B = 2*C;    // B = 2
        D = 2 * B;   // D  = 4
        B = D – 1;   // B  = 3

        C = B – 1;   // C = 1
        D = 2 * B;   // D = 4
        B = D – 1;   // B = 3
        B = 2*C;    // B = 2

        C = B – 1;  // C = 1
        D = 2 * B; // D =  4
        B = 2*C;  // B = 2
        B = D – 1;  // B = 3

        D = 2 * B; // D =  4
        C = B – 1;  // C = 1
        B = 2*C;  // B = 2
        B = D – 1;  // B = 3

        D = 2 * B; // D =  4
        B = D – 1;  // B = 3
        C = B – 1;  // C = 2
        B = 2*C; // B = 4 
        There are 3 different possible values of B: 2, 3 and 4.

    Thank you for asking your query.
     

whatsapp-btn

Do You Want Better RANK in Your Exam?

Start Your Preparations with Eduncle’s FREE Study Material

  • Updated Syllabus, Paper Pattern & Full Exam Details
  • Sample Theory of Most Important Topic
  • Model Test Paper with Detailed Solutions
  • Last 5 Years Question Papers & Answers