Computer Science EngineeringVery hardISRO SC
Global int g = 2; procedure P(a, b) { a = a + 5; b = b + a; print(a + b + g); } is called as P(g, g). The value printed under call by value-result (copy in, copy out left to right: a then b; the print happens before copy-out) is
- A. 42
- B. 18
- C. 21
- D. 23
Correct answer: B. 18
Copy-in: a=b=g=2. a=7; b=2+7=9; g still 2 at the print: 7+9+2.
Practise more Theory of Computation, Compilers & Digital Logic (ISRO CS) questionsTheory of Computation, Compilers & Digital Logic (ISRO CS): notes and key points
More Theory of Computation, Compilers & Digital Logic (ISRO CS) questions
- How many of the following operations are guaranteed to produce a context-free language when applied to context-free languages L1, L2 and a…
- A shift/reduce conflict in a Yacc-style generator that is not resolved by precedence declarations is, by default, resolved by
- The complement of a context-sensitive language is
- A deterministic PDA with acceptance by empty stack (not final state) can accept only languages that are
- Very busy (anticipable) expressions analysis is of the type
- The intersection of two deterministic context-free languages is