cs3005_2025T1_Q1_NA.pdf
Programming in C · Quiz 1 · Jan 2025
← Course papers · Start practice / exam
Questions and published explanations below are available without starting a test. Some questions may not have a published solution yet.
Question 82 MCQ · 2.0 marks
What is the role of the Program Counter (PC) in the CPU?
To store the results of computations
To store the address of the next instruction to execute
To manage input and output operations
To provide temporary data storage
A published solution is not available for this question yet.
Question 83 MCQ · 2.0 marks
What is the correct order of memory levels based on **size** (smallest to largest)?
Cache Memory → Registers → Main Memory → Secondary Memory
Registers → Cache Memory → Main Memory → Secondary Memory
Secondary Memory → Main Memory → Cache Memory → Registers
Main Memory → Cache Memory → Secondary Memory → Registers
A published solution is not available for this question yet.
Question 84 MCQ · 2.0 marks
Which of the following operators in C have right-to-left associativity?
[[IMAGE:0bcd5ac9545b8858_3_2]]

[[IMAGE:0bcd5ac9545b8858_3_3]]

[[IMAGE:0bcd5ac9545b8858_3_4]]

[[IMAGE:0bcd5ac9545b8858_3_5]]

A published solution is not available for this question yet.
Question 85 MCQ · 4.0 marks
Consider the generalized computation given below:
1. R[0] ← M[0]
2. R[1] ← M[1]
3. R[2] = R[1] - R[0]
4. If R[2] != 0, set R[1] = R[1] + 2 and go back to step 3. Otherwise, go to step 5.
5. R[2] = R[0] + R[1]
6. M[2] ← R[2]
For which value of **M[0]** and **M[1]**, the computation will enter into an **infinite loop**?
M[0] = 5, M[1] = 3
M[0] = 7, M[1] = 3
M[0] = 8, M[1] = 2
M[0] = 10, M[1] = 3
A published solution is not available for this question yet.
Question 86 MCQ · 4.0 marks
[[IMAGE:0bcd5ac9545b8858_4_6]]

Subtract values from R1 until R2 is zero
Increment R1 by the sum of values from R2 to 1
Multiply R1 by R2
Divide R1 by R2
A published solution is not available for this question yet.
Question 87 MCQ · 4.0 marks
[[IMAGE:0bcd5ac9545b8858_5_7]]

10
15
0
5
A published solution is not available for this question yet.
Question 88 MCQ · 4.0 marks
[[IMAGE:0bcd5ac9545b8858_6_8]]

[[IMAGE:0bcd5ac9545b8858_6_9]]

[[IMAGE:0bcd5ac9545b8858_6_10]]

[[IMAGE:0bcd5ac9545b8858_6_11]]

[[IMAGE:0bcd5ac9545b8858_6_12]]

A published solution is not available for this question yet.
Question 89 MCQ · 4.0 marks
[[IMAGE:0bcd5ac9545b8858_7_13]]

12
10
15
13
A published solution is not available for this question yet.
Question 90 MCQ · 3.0 marks
Convert the binary number **10101010** to its decimal equivalent.
170
180
160
175
A published solution is not available for this question yet.
Question 91 MCQ · 3.0 marks
Convert the hexadecimal number **0x7C5D** to its equivalent decimal representation:
31835
31836
31837
31838
A published solution is not available for this question yet.
Question 92 MCQ · 3.0 marks
[[IMAGE:0bcd5ac9545b8858_8_14]]

25
15
30
20
A published solution is not available for this question yet.
Question 93 MSQ · 3.0 marks
Which of the following is true for an 8-bit 2's complement representation?
The rightmost bit represents the sign (0 for positive, 1 for negative).
The maximum positive number that can be represented is 127.
The minimum negative number that can be represented is -127.
There are 256 possible values that can be represented.
A published solution is not available for this question yet.
Question 94 MSQ · 2.0 marks
Select all the valid variable names in C:
_123Var
Test-Name
1stValue
break
max_length
A published solution is not available for this question yet.
Question 95 NAT · 3.0 marks
Consider the generalized computation given below:
1. R[0] ← M[0]
2. R[1] ← M[1]
3. R[1] = R[1] - R[0]
4. R[0] = R[0] + R[1]
5. R[1] = R[0] - R[1]
6. M[2] ← R[1]
What will be the value of M[2] at the end of computation if M[0] = 4 and M[1] = 7?
A published solution is not available for this question yet.
Question 96 NAT · 3.0 marks
Find the minimum number of bits required to represent an instruction set where there are **16**
**unique instructions**, and each instruction can take at most **3 operands.**
● The first operand should be able to represent **32 registers.**
● The second operand should be able to represent **-63 to 63** in signed magnitude form.
● The third operand is a single flag (**1-bit**).
A published solution is not available for this question yet.
Question 97 NAT · 4.0 marks
[[IMAGE:0bcd5ac9545b8858_10_15]]

A published solution is not available for this question yet.