uiz Space

May 2025 term · Programming in C · BSCS3005

Programming in C End Term: 31 August 2025, Set QDB3 (May 2025 term)

The IIT Madras BS Programming in C (Programming in C) End Term paper sat on 31 Aug 2025, in the May 2025 term, set QDB3: 24 questions for 100 marks in 180 minutes. Every question is below with its answer. Take it as a timed mock test to be marked, or read it through first.

Questions
24
Marks
100
Duration
180 min
MCQ
20
Numerical
4

Updated

Official paper: IIT M DEGREE AN EXAM QDB3 31 Aug 2025 · No negative marking.

Question 1

+4 marksOne correct option
  1. A
  2. B
  3. C
  4. D
Show answer

Correct answer

  • C

Question 2

+4 marksOne correct option
  1. A

    To exit the loop entirely and continue with the program statement immediately following the loop.

  2. B

    To restart the loop from the beginning.

  3. C

    To immediately proceed to the next iteration of the loop, skipping any remaining statements in the current iteration.

  4. D

    To execute a block of code only a fixed number of times.

Show answer

Correct answer

  • C

    To immediately proceed to the next iteration of the loop, skipping any remaining statements in the current iteration.

Question 3

+4 marksOne correct option

What is a potential risk of a recursive function that is not properly terminated with a base case?

  1. A

    It will cause a compile-time error.

  2. B

    It will always return an incorrect value.

  3. C

    It can lead to a stack overflow, as the function calls consume all available stack memory.

  4. D

    The program will terminate gracefully with a success message.

Show answer

Correct answer

  • C

    It can lead to a stack overflow, as the function calls consume all available stack memory.

Question 4

+4 marksOne correct option

What is the fundamental conceptual difference between "pass-by-value" and "pass-by-reference" for function parameters in C?

  1. A

    Pass-by-value is used for primitive types, while pass-by-reference is used for composite types.

  2. B

    In 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.

  3. C

    Pass-by-value allows a function to modify the original variable, while pass-by- reference protects the original variable from modification.

  4. D

    The choice between pass-by-value and pass-by-reference is made automatically by the compiler based on the variable's type.

Show answer

Correct answer

  • B

    In 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.

Question 5

+4 marksOne correct option
  1. A
  2. B
  3. C
  4. D
Show answer

Correct answer

  • A

Question 6

+4 marksOne correct option
  1. A

    10 10

  2. B

    5 10

  3. C

    5 5

  4. D

    10 5

Show answer

Correct answer

  • A

    10 10

Question 7

+4 marksOne correct option
  1. A
  2. B
  3. C
  4. D
Show answer

Correct answer

  • A

Question 8

+4 marksOne correct option
  1. A

    1

  2. B

    2

  3. C

    3

  4. D

    4

Show answer

Correct answer

  • D

    4

Question 9

+4 marksOne correct option
  1. A

    11 bytes.

  2. B

    12 bytes.

  3. C

    13 bytes.

  4. D

    14 bytes.

Show answer

Correct answer

  • B

    12 bytes.

Question 10

+4 marksOne correct option
  1. A

    {0, 0, 100, 0, 0, 0}

  2. B

    {100, 100, 100, 100, 100, 100}

  3. C

    {100, 0, 0, 0, 0, 0}

  4. D

    {0, 100, 0, 0, 0, 0}

Show answer

Correct answer

  • A

    {0, 0, 100, 0, 0, 0}

Question 11

+4 marksOne correct option
  1. A
  2. B
  3. C
  4. D
Show answer

Correct answer

  • C

Question 12

+4 marksOne correct option
  1. A
  2. B
  3. C
  4. D
Show answer

Correct answer

  • C

Question 13

+4 marksOne correct option
  1. A

    RED = 0, GREEN = 3, BLUE = 1

  2. B

    RED = 1, GREEN = 3, BLUE = 4

  3. C

    RED = 0, GREEN = 3, BLUE = 4

  4. D

    RED = 1, GREEN = 3, BLUE = 2

Show answer

Correct answer

  • C

    RED = 0, GREEN = 3, BLUE = 4

Question 14

+4 marksOne correct option

In C programming, which memory region is typically used for dynamic memory allocation?

  1. A

    Heap memory

  2. B

    Stack memory

  3. C

    Static memory

  4. D

    Code segment

Show answer

Correct answer

  • A

    Heap memory

Question 15

+4 marksOne correct option
  1. A
  2. B
  3. C
  4. D
Show answer

Correct answer

  • B

Question 16

+4 marksOne correct option
  1. A
  2. B
  3. C
  4. D
Show answer

Correct answer

  • B

Question 17

+4 marksOne correct option

When a macro is used in a C program, at what stage is its definition replaced into the code?

  1. A
  2. B
  3. C
  4. D
Show answer

Correct answer

  • C

Question 18

+4 marksOne correct option

Consider the below C program:

What will be the output of the given C program?

  1. A

    16

  2. B

    10

  3. C

    7

  4. D

    12

Show answer

Correct answer

  • C

    7

Question 19

+5 marksOne correct option
  1. A

    (0,0), (0,2), (1,1), (1,3), (2,2), (2,3)

  2. B

    (0,0), (0,2), (0,3), (1,1), (2,2)

  3. C

    (0,0), (0,2), (1,1), (1,3), (2,2)

  4. D

    (0,1), (0,3), (1,1), (1,3), (2,2), (2,3)

Show answer

Correct answer

  • C

    (0,0), (0,2), (1,1), (1,3), (2,2)

Question 20

+5 marksOne correct option

Consider the following C code:

What is the output of the program?

  1. A

    5

  2. B

    101

  3. C

    10

  4. D

    111

Show answer

Correct answer

  • B

    101

Question 21

+4 marksNumerical answer
Show answer

Correct answer: 19

Question 22

+4 marksNumerical answer
Show answer

Correct answer: 2

Question 23

+5 marksNumerical answer

Consider the following C code:

What will be the output of the given program?

Show answer

Correct answer: 9

Question 24

+5 marksNumerical answer
Show answer

Correct answer: 60