Indian Institute of Technology Madras
BS Degree Programme · Examination & Study Paper
Programming in C
All 2025 papers
Examination Instructions & Guidelines
- Solve on notebook/paper first before checking solutions.
- MCQ: Exactly 1 option is correct. Negative marking applies.
- MSQ: One or more options correct. Select all to score.
- NAT: Numerical response. No negative marking.
- Scientific calculator allowed for all calculations.
- Official answer key is sealed at the end of this sheet.
Quiz 1 · 26 Oct 2025 (AN)Quiz 1
- Q1MCQ2 Marks·Choose one option
Which of the following correctly ranks the memory units from fastest to slowest access time?
- ACache → Registers → RAM → Hard Disk → Optical Disk
- BRegisters → Cache → RAM → SSD → Hard Disk
- CRAM → Registers → Cache → SSD → Hard Disk
- DRegisters → RAM → Cache → HDD → SSD
- Q2MCQ2 Marks·Choose one option
In an N-bit signed integer representation using 2’s complement, what is the range of values?
- A

- B

- C

- D

- A
- Q3MCQ2 Marks·Choose one option
Which of the following statements about Boolean conditions in C is true?
- AIn C, 0 represents true, and any non-zero value represents false.
- BIn C, 0 represents false, and any non-zero value represents true.
- CC treats only positive integers as true.
- DIn C, positive integers represent true, and negative integers represent false.
- Q4MCQ3 Marks·Choose one option
The decimal number 2748 is represented in hexadecimal as:
- A0xABC
- B0xABD
- C0xABE
- D0xABF
- Q5MCQ3 Marks·Choose one option
What is the minimum number of bits required to represent all integer values from −120 to +120 in a signed binary representation?
- A5 Bits
- B6 bits
- C7 bits
- D8 bits
- E9 bits
- Q6MCQ3 Marks·Choose one option

- Aa = 13, b = -4, c = 12
- Ba = 12, b = -3, c = 11
- Ca = 14, b = -5, c = 13
- Da = 11, b = -2, c = 10
- Q7MCQ3 Marks·Choose one option

- A100
- B200
- C300
- D400
- Q8MCQ3 Marks·Choose one option

- A6 5 4
- B6 4 5
- C6 3 5
- D6 5 3
- Q9MCQ4 Marks·Choose one option

- ASum of first N natural numbers
- BSum of squares of first N natural numbers
- CSum of cubes of first N natural numbers
- DFactorial of N
- Q10MCQ4 Marks·Choose one option

- A0 1 2 5 6
- B0 1 5 6
- C1 2 3 6
- D1 2 3 5 6
- Q11MSQ2 Marks·Choose all correct options
Which of the following are key functions of the Arithmetic Logic Unit (ALU)?
- AAddition and subtraction
- BLogical comparisons (>, <, =)
- CMemory storage management
- DMultiplication and division
- EInstruction decoding
- Q12MSQ2 Marks·Choose all correct options
Which statement is true about short-circuit evaluation in C?
- AIn expr1 && expr2, if expr1 is false, expr2 is not evaluated.
- BIn expr1 || expr2, if expr1 is true, expr2 is not evaluated.
- CIn expr1 && expr2, if expr1 is true, expr2 is not evaluated.
- DIn expr1 || expr2, if expr1 is false, expr2 is not evaluated.
- Q13MSQ3 Marks·Choose all correct options

- A

- B

- C

- D

- E

- A
- Q14MSQ3 Marks·Choose all correct options

- Aa = 6, b = 4
- Ba = 3, b = 5
- Ca = 2, b = -3
- Da = 4, b = 6
- Q15NAT3 Marks·Write the number
Your answer: - Q16NAT4 Marks·Write the number
Your answer: - Q17NAT4 Marks·Write the number
Your answer:
End Term · 31 Aug 2025 (FN)End Term
- Q18MCQ4 Marks·Choose one option

- APre-increment changes the value after the expression is evaluated, while post- increment changes it before the expression is evaluated.
- BPre-increment changes the value before the expression is evaluated, while post-increment changes it after the expression is evaluated.
- CPre-increment is used with integers, while post-increment is used with floating-point numbers.
- DPre- and Post-increment are identical in operation. They are two ways of writing the same statement.
- Q19MCQ4 Marks·Choose one option

- A

- B

- C

- D

- A
- Q20MCQ4 Marks·Choose one option
When a recursive function is called, how does the call stack (or program stack) manage the function calls?
- AEach new recursive call overwrites the previous function call on the stack.
- BEach new recursive call adds a new stack frame to the top of the stack for its local variables and parameters.
- CThe call stack is not used for recursive functions; a separate data structure is used.
- DThe recursive calls are stored in a queue, waiting to be processed in order.
- Q21MCQ4 Marks·Choose one option

- A

- B

- C

- D

- A
- Q22MCQ4 Marks·Choose one option

- A

- B

- C

- D

- A
- Q23MCQ4 Marks·Choose one option

- A

- B

- C

- D

- A
- Q24MCQ4 Marks·Choose one option

- A

- B

- C

- D

- A
- Q25MCQ4 Marks·Choose one option

- A10
- B20
- C30
- D40
- Q26MCQ4 Marks·Choose one option

- A

- B

- C

- D

- A
- Q27MCQ4 Marks·Choose one option

- A

- B

- C

- D

- A
- Q28MCQ4 Marks·Choose one option
A special data type is declared where multiple members share the same memory location. The size of an instance of this type is equal to the size of its largest member. What kind of data type is this?
- A

- B

- C

- D

- A
- Q29MCQ4 Marks·Choose one option

- A

- B

- C

- D

- A
- Q30MCQ4 Marks·Choose one option
In C programming, which memory region is primarily used for storing local variables of functions and function call information?
- AHeap memory
- BStack memory
- CStatic memory
- DCode segment
- Q31MCQ4 Marks·Choose one option

- A"New Content" is appended to the end, resulting in "Hello WorldNew Content".
- BThe file is cleared, and only "New Content" is written.
- CThe code will fail to open the file because it already exists.
- D"New Content" is inserted at the beginning, pushing "Hello World" to the end.
- Q32MCQ4 Marks·Choose one option

- A

- B

- C

- D

- A
- Q33MCQ4 Marks·Choose one option
What is the primary purpose of the C preprocessor?
- ATo execute the program's logic before the main function.
- BTo convert the source code into machine language.
- CTo process directives and modify the source code before compilation.
- DTo manage dynamic memory allocation during runtime.
- Q34MCQ4 Marks·Choose one option

- A25
- B23
- C17
- D15
- Q35MCQ4 Marks·Choose one option

- A7
- B104
- C4
- D5
- Q36MCQ5 Marks·Choose one option

- A2 4 6 8
- B2 4 6 8 10
- CInfinite loop
- D2 4 6 8 10 12
- Q37MCQ5 Marks·Choose one option

- A0501
- B150
- C501
- D1050
- Q38NAT5 Marks·Write the number
Your answer: - Q39NAT5 Marks·Write the number
Your answer: - Q40NAT4 Marks·Write the number
Your answer: - Q41NAT4 Marks·Write the number
Your answer:
End Term · 31 Aug 2025 (AN)End Term
- Q42MCQ4 Marks·Choose one option

- A

- B

- C

- D

- A
- Q43MCQ4 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.
- Q44MCQ4 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.
- Q45MCQ4 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.
- Q46MCQ4 Marks·Choose one option

- A

- B

- C

- D

- A
- Q47MCQ4 Marks·Choose one option

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

- A

- B

- C

- D

- A
- Q49MCQ4 Marks·Choose one option

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

- A11 bytes.
- B12 bytes.
- C13 bytes.
- D14 bytes.
- Q51MCQ4 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}
- Q52MCQ4 Marks·Choose one option

- A

- B

- C

- D

- A
- Q53MCQ4 Marks·Choose one option

- A

- B

- C

- D

- A
- Q54MCQ4 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
- Q55MCQ4 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
- Q56MCQ4 Marks·Choose one option

- A

- B

- C

- D

- A
- Q57MCQ4 Marks·Choose one option

- A

- B

- C

- D

- A
- Q58MCQ4 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
- Q59MCQ4 Marks·Choose one option
Consider the below C program:
What will be the output of the given C program?- A16
- B10
- C7
- D12
- Q60MCQ5 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)
- Q61MCQ5 Marks·Choose one option
Consider the following C code:
What is the output of the program?- A5
- B101
- C10
- D111
- Q62NAT4 Marks·Write the number
Your answer: - Q63NAT4 Marks·Write the number
Your answer: - Q64NAT5 Marks·Write the number
Consider the following C code:
What will be the output of the given program?Your answer: - Q65NAT5 Marks·Write the number
Your answer:
Official KeyMaster Answer Key & Explanations
Official answer keys from IIT Madras BS past papers. Click any question to review.
Reveal KeyCollapse Key
Master Answer Key & Explanations
Official answer keys from IIT Madras BS past papers. Click any question to review.