cs3005_2026T2_ET_FN.pdf
Programming in C · End Term · May 2026 FN
← 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 2 MCQ · 3.0 marks
Which of the following components is primarily responsible for performing arithmetic and logical
operations in a computer?
Arithmetic Logic Unit (ALU)
Control Unit
Memory Unit
Input Unit
A published solution is not available for this question yet.
Question 3 MCQ · 3.0 marks
A 4-byte integer **0x89ABCDEF** is stored beginning at memory address **4000** in a **Little-Endian**
system.
Which value will be stored at address **4002**?
0x89
0xAB
0xCD
0xEF
A published solution is not available for this question yet.
Question 4 MCQ · 3.0 marks
Consider the following C program.
[[IMAGE:2dfb2c68e2bdce5e_3_2]]
What will be the output?

16
24
32
Garbage value
A published solution is not available for this question yet.
Question 5 MCQ · 3.0 marks
Which of the following statements about **typedef** in C is correct?
It creates a new data type.
It creates an alias (another name) for an existing data type.
It allocates memory for a variable.
It is used only with structures.
A published solution is not available for this question yet.
Question 6 MCQ · 3.0 marks
Which of the following file opening modes allows **reading and writing** while **preserving the**
**existing file contents**?
[[IMAGE:2dfb2c68e2bdce5e_3_3]]

[[IMAGE:2dfb2c68e2bdce5e_3_4]]

[[IMAGE:2dfb2c68e2bdce5e_4_5]]

[[IMAGE:2dfb2c68e2bdce5e_4_6]]

A published solution is not available for this question yet.
Question 7 MCQ · 3.0 marks
Consider the following C program.
[[IMAGE:2dfb2c68e2bdce5e_4_7]]
What will be the output?

24
14
16
12
A published solution is not available for this question yet.
Question 8 NAT · 4.0 marks
Consider the following computation steps.
[[IMAGE:2dfb2c68e2bdce5e_5_8]]
What is the final value stored in **R[3]**?

A published solution is not available for this question yet.
Question 9 NAT · 4.0 marks
Consider the following C program.
[[IMAGE:2dfb2c68e2bdce5e_5_9]]
(ASCII value of **'B'** is **66**.)
What will be the output?

A published solution is not available for this question yet.
Question 10 NAT · 4.0 marks
Consider the following C program.
[[IMAGE:2dfb2c68e2bdce5e_6_10]]
What will be the output?

A published solution is not available for this question yet.
Question 11 MCQ · 5.0 marks
Consider the following generalized memory computations.
[[IMAGE:2dfb2c68e2bdce5e_7_11]]
What is the final value stored in **M[3]**?

12
18
14
21
A published solution is not available for this question yet.
Question 12 MCQ · 5.0 marks
The decimal equivalent of the following **8-bit signed two's complement** number is
[[IMAGE:2dfb2c68e2bdce5e_7_12]]

-14
-16
-18
242
A published solution is not available for this question yet.
Question 13 MCQ · 5.0 marks
Consider the following C code.
[[IMAGE:2dfb2c68e2bdce5e_8_13]]
What will be the output?

4
5
6
7
A published solution is not available for this question yet.
Question 14 MCQ · 5.0 marks
Consider the following recursive function.
[[IMAGE:2dfb2c68e2bdce5e_9_14]]
What will be the output?

12
16
20
28
A published solution is not available for this question yet.
Question 15 MCQ · 5.0 marks
Consider the following C program.
[[IMAGE:2dfb2c68e2bdce5e_10_15]]
What will be the output?

A
G
U
E
A published solution is not available for this question yet.
Question 16 MCQ · 5.0 marks
Consider the following C program.
[[IMAGE:2dfb2c68e2bdce5e_10_16]]
What will be the output?

6
8
10
14
A published solution is not available for this question yet.
Question 17 MCQ · 4.0 marks
Which stage of the C compilation process is responsible for expanding macros and processing
header files?
Linking
Loading
Preprocessing
Execution
A published solution is not available for this question yet.
Question 18 MCQ · 4.0 marks
Consider the following C program.
[[IMAGE:2dfb2c68e2bdce5e_11_17]]
What will be the output?

10 15
15 20
15 15
20 20
A published solution is not available for this question yet.
Question 19 MCQ · 4.0 marks
Which preprocessor directive is used to include the contents of another source or header file into
the current program?
[[IMAGE:2dfb2c68e2bdce5e_12_18]]

[[IMAGE:2dfb2c68e2bdce5e_12_19]]

[[IMAGE:2dfb2c68e2bdce5e_12_20]]

[[IMAGE:2dfb2c68e2bdce5e_12_21]]

A published solution is not available for this question yet.
Question 20 MCQ · 4.0 marks
Consider the following C program.
[[IMAGE:2dfb2c68e2bdce5e_12_22]]
What will be the output?

5
8
13
Compilation Error
A published solution is not available for this question yet.
Question 21 MSQ · 3.0 marks
Which of the following statements are correct regarding **character encoding**?
ASCII uses 7 bits.
UTF-8 is backward compatible with ASCII.
Every UTF-8 character occupies exactly 8 bits.
Unicode supports a much larger character set than ASCII.
A published solution is not available for this question yet.
Question 22 NAT · 5.0 marks
Consider the following C program.
[[IMAGE:2dfb2c68e2bdce5e_14_23]]
What will be the output printed on the screen?

A published solution is not available for this question yet.
Question 23 NAT · 5.0 marks
Consider the following C program.
[[IMAGE:2dfb2c68e2bdce5e_15_24]]
What will be the output?

A published solution is not available for this question yet.
Question 24 NAT · 3.0 marks
Consider the following C program.
[[IMAGE:2dfb2c68e2bdce5e_16_25]]
What will be the output?

A published solution is not available for this question yet.
Question 25 NAT · 3.0 marks
Consider the following C program.
[[IMAGE:2dfb2c68e2bdce5e_17_26]]
What will be the output?

A published solution is not available for this question yet.
Question 26 MSQ · 5.0 marks
Which of the following statements about pointers are correct?
A pointer variable stores the address of another variable.
Pointer arithmetic depends on the data type of the pointer.
Dereferencing a NULL pointer is safe.
Two pointers can point to the same memory location.
A published solution is not available for this question yet.