cs3005_2026T1_Q1_NA.pdf
Programming in C · Quiz 1 · Jan 2026
← 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 · 5.0 marks
What is the decimal equivalent of the following **8-bit signed binary number represented using**
**the two’s complement convention**?
(11100101)2
-27
-21
-35
229
A published solution is not available for this question yet.
Question 3 MCQ · 5.0 marks
[[IMAGE:1687b6e47cd9d926_3_2]]

4
5
6
7
A published solution is not available for this question yet.
Question 4 MCQ · 5.0 marks
[[IMAGE:1687b6e47cd9d926_4_3]]

8
4
5
6
A published solution is not available for this question yet.
Question 5 MCQ · 5.0 marks
Consider the following C program:
[[IMAGE:1687b6e47cd9d926_4_4]]
What will be the output?

50
10
Garbage value
Compilation error
A published solution is not available for this question yet.
Question 6 MCQ · 3.0 marks
Consider the code:
[[IMAGE:1687b6e47cd9d926_5_5]]
What will be the value of c?

14
12
17
19
A published solution is not available for this question yet.
Question 7 MCQ · 3.0 marks
What is the correct way to access a structure member using a pointer to a structure?
[[IMAGE:1687b6e47cd9d926_5_6]]

[[IMAGE:1687b6e47cd9d926_5_7]]

[[IMAGE:1687b6e47cd9d926_5_8]]

[[IMAGE:1687b6e47cd9d926_5_9]]

A published solution is not available for this question yet.
Question 8 MCQ · 3.0 marks
We want to dynamically allocate memory at runtime for **10 integer elements** and store the
returned address in a pointer. Which of the following statements is correct?
[[IMAGE:1687b6e47cd9d926_6_10]]

[[IMAGE:1687b6e47cd9d926_6_11]]

[[IMAGE:1687b6e47cd9d926_6_12]]

[[IMAGE:1687b6e47cd9d926_6_13]]

A published solution is not available for this question yet.
Question 9 MCQ · 3.0 marks
In C preprocessor directives, what does the [[IMAGE:1687b6e47cd9d926_6_14]] operator do when used in macro definitions?

Concatenates two tokens
Compares two tokens
Excludes a token
Multiplies two tokens
A published solution is not available for this question yet.
Question 10 MCQ · 4.0 marks
Consider the following C program:
[[IMAGE:1687b6e47cd9d926_7_15]]
What will be the output?

15
10
5
Garbage value
A published solution is not available for this question yet.
Question 11 MCQ · 4.0 marks
A 4-byte integer [[IMAGE:1687b6e47cd9d926_7_16]] is stored starting at memory address [[IMAGE:1687b6e47cd9d926_7_17]] . What value will be
stored at address [[IMAGE:1687b6e47cd9d926_7_18]] in a **Little-Endian system**?



[[IMAGE:1687b6e47cd9d926_7_19]]

[[IMAGE:1687b6e47cd9d926_7_20]]

[[IMAGE:1687b6e47cd9d926_7_21]]

[[IMAGE:1687b6e47cd9d926_7_22]]

A published solution is not available for this question yet.
Question 12 MCQ · 4.0 marks
Consider the following code:
[[IMAGE:1687b6e47cd9d926_8_23]]
What will be the output?

[[IMAGE:1687b6e47cd9d926_8_24]]

[[IMAGE:1687b6e47cd9d926_8_25]]

[[IMAGE:1687b6e47cd9d926_8_26]]

[[IMAGE:1687b6e47cd9d926_8_27]]

A published solution is not available for this question yet.
Question 13 MCQ · 4.0 marks
[[IMAGE:1687b6e47cd9d926_8_28]]
What will be the output of the given code?

1 3 4 5
0 3 3 4
0 1 2 3
0 3 4 5
A published solution is not available for this question yet.
Question 14 MCQ · 4.0 marks
[[IMAGE:1687b6e47cd9d926_9_29]]

[[IMAGE:1687b6e47cd9d926_9_30]]

[[IMAGE:1687b6e47cd9d926_9_31]]

[[IMAGE:1687b6e47cd9d926_9_32]]

[[IMAGE:1687b6e47cd9d926_9_33]]

A published solution is not available for this question yet.
Question 15 MCQ · 4.0 marks
Assume [[IMAGE:1687b6e47cd9d926_9_34]] contains:
[[IMAGE:1687b6e47cd9d926_9_35]]
Consider the following C code snippet. What will be printed on the screen?
[[IMAGE:1687b6e47cd9d926_10_36]]



[[IMAGE:1687b6e47cd9d926_10_37]]

[[IMAGE:1687b6e47cd9d926_10_38]]

[[IMAGE:1687b6e47cd9d926_10_39]]

[[IMAGE:1687b6e47cd9d926_10_40]]

A published solution is not available for this question yet.
Question 16 MCQ · 4.0 marks
Consider the C program below.
[[IMAGE:1687b6e47cd9d926_10_41]]
What will be the output of the above C program?

63
45
27
14
A published solution is not available for this question yet.
Question 17 MSQ · 5.0 marks
Consider the following C program:
[[IMAGE:1687b6e47cd9d926_11_42]]
Which of the following statements are correct?

[[IMAGE:1687b6e47cd9d926_11_43]] becomes 12

[[IMAGE:1687b6e47cd9d926_11_44]] becomes 12

[[IMAGE:1687b6e47cd9d926_11_45]] and [[IMAGE:1687b6e47cd9d926_11_46]] both point to [[IMAGE:1687b6e47cd9d926_11_47]]



[[IMAGE:1687b6e47cd9d926_11_48]] and [[IMAGE:1687b6e47cd9d926_11_49]] both point to [[IMAGE:1687b6e47cd9d926_11_50]]



A published solution is not available for this question yet.
Question 18 MSQ · 4.0 marks
Which of the following statements about arrays in C are correct?
Array elements are stored in contiguous memory locations.
Array size can be changed after declaration.
The array name acts like a pointer to the first element in most expressions.
Arrays can store elements of different data types.
Array indexing starts from 0.
A published solution is not available for this question yet.
Question 19 MSQ · 4.0 marks
Which of the following statements about [[IMAGE:1687b6e47cd9d926_12_51]] in C are correct?

Size of the [[IMAGE:1687b6e47cd9d926_12_52]] is equal to the sum of all member sizes

All members share the same memory location
Each member has its own separate memory
Only one member can hold a valid value at a time
A published solution is not available for this question yet.
Question 20 MSQ · 3.0 marks
Which of the following file modes **delete the existing content of a file when opened**?
"w"
"w+"
"r+"
"a"
A published solution is not available for this question yet.
Question 21 NAT · 5.0 marks
Consider the following computation steps:
1. R[0] = 2
2. R[1] = 3
3. R[1] = R[1] + R[0]
4. R[0] = R[0] + 1
5. If R[0] ≤ 5 go to step-3, otherwise, go to step-6
6. R[2] = R[1]
What is the final value of R[2] at the end of computation?
A published solution is not available for this question yet.
Question 22 NAT · 5.0 marks
Consider the following C program:
[[IMAGE:1687b6e47cd9d926_13_53]]
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:1687b6e47cd9d926_14_54]]
What will be the **output printed on the screen**?

A published solution is not available for this question yet.
Question 24 NAT · 5.0 marks
Consider the following C code:
[[IMAGE:1687b6e47cd9d926_15_55]]
What will be the output?

A published solution is not available for this question yet.
Question 25 NAT · 4.0 marks
Consider the following C code snippet. What will be the output?
[[IMAGE:1687b6e47cd9d926_16_56]]

A published solution is not available for this question yet.