Multiple choice

Match the following ||| |---|---| | (1) local variables | (a) stack | | (2) global variable | (b) register | | (3) register variable | (c) main memory | | (4) Static variable | (d) data memory |

  1. 1-a, 2-b, 3-c, 4-d

  2. 1-a, 2-d, 3-b, 4-c

  3. 1-a, 2-c, 3-b, 4-d

  4. None of these

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

Local variables are stored on the stack, while global and static variables are stored in the data segment of main memory. Register variables are stored in CPU registers for faster access, matching the pairs 1-a, 2-d, 3-b, and 4-c.