Quiz Space

January 2025 term · Programming in C · BSCS3005

Programming in C End Term: 13 April 2025, Set QEF1 (January 2025 term)

The IIT Madras BS Programming in C (Programming in C) End Term paper sat on 13 Apr 2025, in the January 2025 term, set QEF1: 20 questions for 43 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
20
Marks
43
Duration
180 min
MCQ
13
MSQ
2
Numerical
5

Updated

Official paper: IIT M ES REATTEMPT AN EXAM QEQ1 13 Apr · No negative marking.

Question 1

+4 marksOne correct option
  1. A

    1 2 3

  2. B

    4 6 8

  3. C

    5 12 10

  4. D

    8 6 10

Show answer

Correct answer

  • C

    5 12 10

Question 2

+4 marksOne correct option

Which of the following is true about recursion?

  1. A

    Reduces the execution time significantly in comparison to using loops

  2. B

    Reduces the Memory requirement significantly in comparison to using loops

  3. C

    Reduces the Amount of lines of codes needed for performing tasks withrepeating sub-structure

  4. D

    All of these

Show answer

Correct answer

  • C

    Reduces the Amount of lines of codes needed for performing tasks withrepeating sub-structure

Question 3

+4 marksOne correct option

A 32-bit integer 0x12345678 is stored in memory starting at address 0x3000 on a little-endian system. Which of the following correctly represents the memory layout (address and stored values)?

  1. A

    0x3000: 120x3001: 34
    0x3002: 56
    0x3003: 78

  2. B

    0x3000: 780x3001: 56 0x3002: 34
    0x3003: 12

  3. C

    0x3000: 560x3001: 78
    0x3002: 12
    0x3003: 34

  4. D

    0x3000: 120x3004: 34
    0x3008: 56
    0x300C: 78

Show answer

Correct answer

  • B

    0x3000: 780x3001: 56 0x3002: 34
    0x3003: 12

Question 4

+4 marksOne correct option

Which of the following statements correctly declares a pointer variable ptr to hold the address of a character variable ch in C and assigns the address of ch to ptr?

  1. A

    char *ptr; ptr = &ch;

  2. B

    char *ptr; ptr = *ch;

  3. C

    char ptr; ptr = &ch;

  4. D

    char ptr; ptr = *ch;

Show answer

Correct answer

  • A

    char *ptr; ptr = &ch;

Question 5

+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 6

+4 marksOne correct option

What does the #define directive do in C preprocessor?

  1. A

    Declares a variable with the value to initialize it.

  2. B

    Defines textual symbols which are replaced by their values before compilation.

  3. C

    Defines a function which may have parameters

  4. D

    Includes a header file.

Show answer

Correct answer

  • B

    Defines textual symbols which are replaced by their values before compilation.

Question 7

+5 marksOne correct option
  1. A

    18

  2. B

    21

  3. C

    22

  4. D

    24

Show answer

Correct answer

  • B

    21

Question 8

+5 marksOne correct option
  1. A

    20 20

  2. B

    10 10

  3. C

    10 20

  4. D

    20 10

Show answer

Correct answer

  • D

    20 10

Question 9

+5 marksOne correct option
  1. A

    Hello

  2. B

    lo World

  3. C

    llo World

  4. D

    o World

Show answer

Correct answer

  • B

    lo World

Question 10

+5 marksOne correct option
  1. A

    [3,5,4,7,6,2]

  2. B

    [6,5,4,3,2,1]

  3. C

    [4,3,2,5,1,6]

  4. D

    [5,3,2,6,1,4]

Show answer

Correct answer

  • C

    [4,3,2,5,1,6]

Question 11

+5 marksOne correct option
  1. A

    19

  2. B

    45

  3. C

    26

  4. D

    20

Show answer

Correct answer

  • A

    19

Question 12

+3 marksOne correct option
  1. A

    {5, 5, 5, 5, 5}

  2. B

    {5, 0, 0, 0, 0}

  3. C

    {5, (garbage), (garbage), (garbage), (garbage)}

  4. D

    {(garbage), (garbage), (garbage), (garbage), 5}

Show answer

Correct answer

  • B

    {5, 0, 0, 0, 0}

Question 13

+3 marksOne correct option

Which of the following is not a valid storage class in C language?

  1. A

    extern

  2. B

    dynamic

  3. C

    register

  4. D

    auto

Show answer

Correct answer

  • B

    dynamic

Question 14

+4 marksOne or more correct options

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

Select all that apply.

  1. A

    The break statement is compulsory to use with switch statement.

  2. B

    The default statement is compulsory to use with switch statement.

  3. C

    The default statement is optional with switch statement.

  4. D

    Multiple case labels can be used with switch statement.

Show answer

Correct answers

  • C

    The default statement is optional with switch statement.

  • D

    Multiple case labels can be used with switch statement.

Question 15

+4 marksOne or more correct options

Which of the following statements about pointers is/are true?

Select all that apply.

  1. A

    A pointer can be incremented to point to the next memory location of its type.

  2. B

    A pointer variable cannot be reassigned after initialization.

  3. C

    Dereferencing a pointer gives the value stored at the memory address it holds.

  4. D

    Dereferencing a pointer gives the memory address it holds.

Show answer

Correct answers

  • A

    A pointer can be incremented to point to the next memory location of its type.

  • C

    Dereferencing a pointer gives the value stored at the memory address it holds.

Question 16

+4 marksNumerical answer
Show answer

Correct answer: 5

Question 17

+4 marksNumerical answer
Show answer

Correct answer: 11

Question 18

+4 marksNumerical answer
Show answer

Correct answer: 5

Question 19

+5 marksNumerical answer
Show answer

Correct answer: 19

Question 20

+5 marksNumerical answer
Show answer

Correct answer: 32