uiz Space

September 2025 term · Programming in C · BSCS3005

Programming in C End Term: 21 December 2025 (September 2025 term)

The IIT Madras BS Programming in C (Programming in C) End Term paper sat on 21 Dec 2025, in the September 2025 term: 25 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
25
Marks
100
Duration
180 min
MSQ
5
MCQ
17
Numerical
3

Updated

Official paper: Programming In C 18 Dec 25 · No negative marking.

Question 1

+3 marksOne or more correct options

Which of the following statements are true about the switch statement in C?

Select all that apply.

  1. A

    default case is compulsory in every switch.

  2. B

    Multiple case labels can share the same code block.

  3. C

    break is optional in a switch case.

  4. D

    A switch can be written inside another switch.

Show answer

Correct answers

  • B

    Multiple case labels can share the same code block.

  • C

    break is optional in a switch case.

  • D

    A switch can be written inside another switch.

Question 2

+4 marksOne correct option

What will be the output of the following program?

  1. A

    z = 19

  2. B

    z = 11

  3. C

    z = 0

  4. D

    z = 5

Show answer

Correct answer

  • C

    z = 0

Question 3

+5 marksOne correct option

What will be the output of the following program?

  1. A

    1 3 5 7

  2. B

    1 3 3 5 7

  3. C

    1 3 5

  4. D

    1 9 3

Show answer

Correct answer

  • D

    1 9 3

Question 4

+5 marksOne correct option

What will be the output of the following program?

  1. A

    Inside: a = 7, b = 3 Outside: x = 3, y = 7

  2. B

    Inside: a = 7, b = 3 Outside: x = 7, y = 3

  3. C

    Inside: a = 3, b = 7 Outside: x = 7, y = 3

  4. D

    Inside: a = 3, b = 7 Outside: x = 3, y = 7

Show answer

Correct answer

  • B

    Inside: a = 7, b = 3 Outside: x = 7, y = 3

Question 5

+4 marksOne correct option

Consider the following program.

Assuming each function must complete before its result is used in the next function call, in which sequence are the functions executed?

  1. A

    main → sub → sub → divi → printf

  2. B

    main → printf → sub → sub → divi

  3. C

    main → divi → sub → sub → printf

  4. D

    main → sub → divi → sub → printf

Show answer

Correct answer

  • A

    main → sub → sub → divi → printf

Question 6

+3 marksOne or more correct options

Which of the following is true about recursion in C?

Select all that apply.

  1. A

    Every recursive function must have a base case.

  2. B

    Recursive functions are always faster than iterative ones.

  3. C

    Recursion always leads to infinite calls.

  4. D

    A recursive function can call itself directly or indirectly.

Show answer

Correct answers

  • A

    Every recursive function must have a base case.

  • D

    A recursive function can call itself directly or indirectly.

Question 7

+3 marksOne correct option

Which of the following correctly declares and initializes a pointer to a float variable f?

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

Correct answer

  • B

Question 8

+4 marksOne correct option

What will be the output of the following program?

  1. A

    Hello

  2. B

    World

  3. C

    o World

  4. D

    ello World

Show answer

Correct answer

  • B

    World

Question 9

+5 marksNumerical answer

What will be the output of the following program?

Show answer

Correct answer: 13

Question 10

+5 marksOne or more correct options

Consider the following program.

If the output is 450, which of the following lines could replace the missing statement?

Select all that apply.

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

Correct answers

  • A
  • C

Question 11

+3 marksOne correct option

Which operator is used in C for dynamic memory deallocation?

  1. A

    free()

  2. B

    delete

  3. C

    remove()

  4. D

    dispose()

Show answer

Correct answer

  • A

    free()

Question 12

+4 marksOne correct option

What will be the output of the following program?

  1. A

    5

  2. B

    4

  3. C

    0

  4. D

    1

Show answer

Correct answer

  • B

    4

Question 13

+5 marksOne correct option

What will be the output of the following program?

  1. A

    20

  2. B

    30

  3. C

    99

  4. D

    Garbage Value

Show answer

Correct answer

  • C

    99

Question 14

+5 marksOne or more correct options

Which of the following are valid storage classes in C?

Select all that apply.

  1. A

    auto

  2. B

    static

  3. C

    volatile

  4. D

    extern

Show answer

Correct answers

  • A

    auto

  • B

    static

  • D

    extern

Question 15

+3 marksOne correct option

What will be the output of the following program?

  1. A

    3

  2. B

    5

  3. C

    6

  4. D

    7

Show answer

Correct answer

  • C

    6

Question 16

+4 marksNumerical answer

What will be the output of the following program?

Show answer

Correct answer: 48

Question 17

+3 marksOne correct option

Which keyword in C prevents a variable from being modified after initialization?

  1. A

    restrict

  2. B

    volatile

  3. C

    const

  4. D

    static

Show answer

Correct answer

  • C

    const

Question 18

+5 marksOne correct option

What will be the output of the following program?

  1. A

    5 5 5

  2. B

    5 6 7

  3. C

    7 7 7

  4. D

    10 11 11

Show answer

Correct answer

  • B

    5 6 7

Question 19

+4 marksOne correct option

What will be the output of the following program?

  1. A

    a P

  2. B

    a r

  3. C

    a e

  4. D

    e p

Show answer

Correct answer

  • B

    a r

Question 20

+3 marksOne or more correct options

Which of the following are valid file handling modes in C?

Select all that apply.

  1. A

    "rb"

  2. B

    "wx"

  3. C

    "a+"

  4. D

    "r+"

Show answer

Correct answers

  • A

    "rb"

  • C

    "a+"

  • D

    "r+"

Question 21

+5 marksOne correct option

Consider the following program.

If data.txt is empty before execution, what will be printed?

  1. A

    Nothing

  2. B

    H

  3. C

    e

  4. D

    Error

Show answer

Correct answer

  • B

    H

Question 22

+4 marksOne correct option

What will be the output of the following program?

  1. A

    B

  2. B

    A

  3. C

    F

  4. D

    0

Show answer

Correct answer

  • A

    B

Question 23

+3 marksOne correct option

In macros, which operator is used to substitute the actual argument as a string?

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

    (A figure from the original paper is missing from the source site.)

Show answer

Correct answer

  • B

Question 24

+4 marksNumerical answer

What will be the output of the following program?

Show answer

Correct answer: 11

Question 25

+4 marksOne correct option

What will be the output of the following program?

  1. A

    5

  2. B

    4

  3. C

    20

  4. D

    Compiler error

Show answer

Correct answer

  • A

    5