Indian Institute of Technology Madras
BS Degree Programme · Examination & Study Paper
Programming in C
End Term · 31 Aug 2025 (Afternoon)
Examination Instructions & Guidelines
- Solve on notebook/paper first before checking solutions.
- MCQ: Exactly 1 option is correct. Negative marking applies.
- NAT: Numerical response. No negative marking.
- Scientific calculator allowed for all calculations.
- Official answer key is sealed at the end of this sheet.
- Q1MCQ4 Marks·Choose one option

- A

- B

- C

- D

- A
- Q2MCQ4 Marks·Choose one option

- ATo exit the loop entirely and continue with the program statement immediately following the loop.
- BTo restart the loop from the beginning.
- CTo immediately proceed to the next iteration of the loop, skipping any remaining statements in the current iteration.
- DTo execute a block of code only a fixed number of times.
- Q3MCQ4 Marks·Choose one option
What is a potential risk of a recursive function that is not properly terminated with a base case?
- AIt will cause a compile-time error.
- BIt will always return an incorrect value.
- CIt can lead to a stack overflow, as the function calls consume all available stack memory.
- DThe program will terminate gracefully with a success message.
- Q4MCQ4 Marks·Choose one option
What is the fundamental conceptual difference between "pass-by-value" and "pass-by-reference" for function parameters in C?
- APass-by-value is used for primitive types, while pass-by-reference is used for composite types.
- BIn pass-by-value, a function works with a copy of the argument, whereas in pass-by-reference, it works with the original variable via its memory address.
- CPass-by-value allows a function to modify the original variable, while pass-by- reference protects the original variable from modification.
- DThe choice between pass-by-value and pass-by-reference is made automatically by the compiler based on the variable's type.
- Q5MCQ4 Marks·Choose one option

- A

- B

- C

- D

- A
- Q6MCQ4 Marks·Choose one option

- A10 10
- B5 10
- C5 5
- D10 5
- Q7MCQ4 Marks·Choose one option

- A

- B

- C

- D

- A
- Q8MCQ4 Marks·Choose one option

- A1
- B2
- C3
- D4
- Q9MCQ4 Marks·Choose one option

- A11 bytes.
- B12 bytes.
- C13 bytes.
- D14 bytes.
- Q10MCQ4 Marks·Choose one option

- A{0, 0, 100, 0, 0, 0}
- B{100, 100, 100, 100, 100, 100}
- C{100, 0, 0, 0, 0, 0}
- D{0, 100, 0, 0, 0, 0}
- Q11MCQ4 Marks·Choose one option

- A

- B

- C

- D

- A
- Q12MCQ4 Marks·Choose one option

- A

- B

- C

- D

- A
- Q13MCQ4 Marks·Choose one option

- ARED = 0, GREEN = 3, BLUE = 1
- BRED = 1, GREEN = 3, BLUE = 4
- CRED = 0, GREEN = 3, BLUE = 4
- DRED = 1, GREEN = 3, BLUE = 2
- Q14MCQ4 Marks·Choose one option
In C programming, which memory region is typically used for dynamic memory allocation?
- AHeap memory
- BStack memory
- CStatic memory
- DCode segment
- Q15MCQ4 Marks·Choose one option

- A

- B

- C

- D

- A
- Q16MCQ4 Marks·Choose one option

- A

- B

- C

- D

- A
- Q17MCQ4 Marks·Choose one option
When a macro is used in a C program, at what stage is its definition replaced into the code?
- A

- B

- C

- D

- A
- Q18MCQ4 Marks·Choose one option
Consider the below C program:
What will be the output of the given C program?- A16
- B10
- C7
- D12
- Q19MCQ5 Marks·Choose one option

- A(0,0), (0,2), (1,1), (1,3), (2,2), (2,3)
- B(0,0), (0,2), (0,3), (1,1), (2,2)
- C(0,0), (0,2), (1,1), (1,3), (2,2)
- D(0,1), (0,3), (1,1), (1,3), (2,2), (2,3)
- Q20MCQ5 Marks·Choose one option
Consider the following C code:
What is the output of the program?- A5
- B101
- C10
- D111
- Q21NAT4 Marks·Write the number
Your answer: - Q22NAT4 Marks·Write the number
Your answer: - Q23NAT5 Marks·Write the number
Consider the following C code:
What will be the output of the given program?Your answer: - Q24NAT5 Marks·Write the number
Your answer: