Quiz Space

September 2023 term · Programming in C · BSCS3005

Programming in C End Term: 24 December 2023, Set 2 (September 2023 term)

The IIT Madras BS Programming in C (Programming in C) End Term paper sat on 24 Dec 2023, in the September 2023 term, set 2: 26 questions for 101 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
26
Marks
101
Duration
180 min
MCQ
18
MSQ
6
Written
2

Updated

Official paper: IIT M ES FOUNDATION FN EXAM FEF2 24 Dec 2023 · No negative marking.

Question 1

+1 markOne correct option

THIS IS QUESTION PAPER FOR THE SUBJECT "FOUNDATION LEVEL : INTRODUCTION TO C PROGRAMMING (COMPUTER BASED EXAM)" ARE YOU SURE YOU HAVE TO WRITE EXAM FOR THIS SUBJECT? CROSS CHECK YOUR HALL TICKET TO CONFIRM THE SUBJECTS TO BE WRITTEN. (IF IT IS NOT THE CORRECT SUBJECT, PLS CHECK THE SECTION AT THE TOP FOR THE SUBJECTS REGISTERED BY YOU)

  1. A

    YES

  2. B

    NO

Show answer

Correct answer

  • A

    YES

Question 2

+4 marksOne correct option
Figure from the original question paper
  1. A

    Value of a is 30Value of a is 30

  2. B

    Value of a is 30Value of a is 10

  3. C

    Value of a is 10Value of a is 10

  4. D

    Value of a is 10Value of a is 30

Show answer

Correct answer

  • A

    Value of a is 30Value of a is 30

Question 3

+4 marksOne correct option
Figure from the original question paper
  1. A

    12

  2. B

    2

  3. C

    16

  4. D

    1

  5. E

    64

Show answer

Correct answer

  • E

    64

Question 4

+4 marksOne correct option
Figure from the original question paper
  1. A

    Compile Time Error

  2. B

    239 314

  3. C

    234 316

  4. D

    239 316

  5. E

    234 314

Show answer

Correct answer

  • C

    234 316

Question 5

+4 marksOne correct option
Figure from the original question paper
  1. A

    3

  2. B

    4

  3. C

    5

  4. D

    6

Show answer

Correct answer

  • D

    6

Question 6

+4 marksOne correct option
Figure from the original question paper
  1. A

    The value is: 4

  2. B

    The value is: 8

  3. C

    The value is: 16

  4. D

    The value is: 2

Show answer

Correct answer

  • B

    The value is: 8

Question 7

+4 marksOne correct option

Consider an integer variable holding a value “0x89209899”. Suppose the available memory addresses are starting from the address “0x128” in a machine, which of the following stores this multibyte data in the little endian way?

  1. A
    Figure from the original question paper
  2. B
    Figure from the original question paper
  3. C
    Figure from the original question paper
  4. D
    Figure from the original question paper
Show answer

Correct answer

  • C
    Figure from the original question paper

Question 8

+4 marksOne correct option

Which of the following statements about array initialization in C is correct?

  1. A

    Arrays can only be initialized at the time of declaration.

  2. B

    Arrays can be initialized both at the time of declaration and later in theprogram.

  3. C

    Arrays can only be initialized with integer values.

  4. D

    The index of the first element in an array is always 1.

Show answer

Correct answer

  • B

    Arrays can be initialized both at the time of declaration and later in theprogram.

Question 9

+4 marksOne correct option
Figure from the original question paper
  1. A

    Hello C Programming !!

  2. B

    Hello C Programming

  3. C

    C Programming

  4. D

    C Programming !!

  5. E

    Programming

  6. F

    Programming !!

Show answer

Correct answer

  • D

    C Programming !!

Question 10

+4 marksOne correct option
Figure from the original question paper
  1. A
    Figure from the original question paper
  2. B
    Figure from the original question paper
  3. C
    Figure from the original question paper
  4. D
    Figure from the original question paper
Show answer

Correct answer

  • A
    Figure from the original question paper

Question 11

+4 marksOne correct option

What will be the output of the above program?

What will be the output of the above program?
  1. A

    0

  2. B

    6

  3. C

    7

  4. D

    1

Show answer

Correct answer

  • A

    0

Question 12

+4 marksOne correct option

Which of the following statements is true about unions in C?

  1. A

    Unions allow you to store values of different data types at a time in differentmembers.

  2. B

    Unions can only contain elements of the same data type.

  3. C

    Unions always consume more memory than structs.

  4. D

    Unions are used to define functions.

Show answer

Correct answer

  • A

    Unions allow you to store values of different data types at a time in differentmembers.

Question 13

+4 marksOne correct option
Figure from the original question paper
  1. A

    4, 20

  2. B

    4, 40

  3. C

    8, 20

  4. D

    8, 40

Show answer

Correct answer

  • C

    8, 20

Question 14

+4 marksOne correct option
Figure from the original question paper
  1. A

    *(A + iR + j)

  2. B

    *(A + jC + i)

  3. C

    *(A + iC + j)

  4. D

    *(A + jR + i)

Show answer

Correct answer

  • C

    *(A + iC + j)

Question 15

+4 marksOne correct option
Figure from the original question paper
  1. A

    Remove all data from file and write "1,2,3" to "numbers.txt".

  2. B

    Remove all data from file and write "1 2 3" to "numbers.txt".

  3. C

    Appends "1,2,3" to "numbers.txt".

  4. D

    Appends "1 2 3" to "numbers.txt".

Show answer

Correct answer

  • D

    Appends "1 2 3" to "numbers.txt".

Question 16

+4 marksOne correct option
Figure from the original question paper
  1. A

    9BB1

  2. B

    9BA1

  3. C

    BBA1

  4. D

    BBB1

Show answer

Correct answer

  • B

    9BA1

Question 17

+4 marksOne correct option
Figure from the original question paper
  1. A

    34

  2. B

    7

  3. C

    12

  4. D

    Compilation error

Show answer

Correct answer

  • A

    34

Question 18

+4 marksOne correct option

Which of the following preprocessor directives is used to define macros in C?

  1. A

    define

  2. B

    include

  3. C

    ifdef

  4. D

    undef

Show answer

Correct answer

  • A

    define

Question 19

+4 marksOne or more correct options

Which of the following statements is/are true regarding functions in C Language?

Select all that apply.

  1. A

    A function signature must indicate the data type of all the functionparameters.

  2. B

    A function signature must indicate the variable names for the functionparameters.

  3. C

    A function does not always return a value.

  4. D

    A function cannot accept more than 2 parameters.

Show answer

Correct answers

  • A

    A function signature must indicate the data type of all the functionparameters.

  • C

    A function does not always return a value.

Question 20

+4 marksOne or more correct options

In C, which of the following is/are valid operations on pointer variables? (Select all that apply)

Select all that apply.

  1. A

    Dividing one pointer variable by another pointer variable.

  2. B

    Comparing two pointers variables for equality.

  3. C

    Incrementing/Decrementing a pointer variable (e.g. ptr++/ ptr–).

  4. D

    Multiplying two pointer variables.

Show answer

Correct answers

  • B

    Comparing two pointers variables for equality.

  • C

    Incrementing/Decrementing a pointer variable (e.g. ptr++/ ptr–).

Question 21

+4 marksOne or more correct options
Figure from the original question paper

Select all that apply.

  1. A

    *a

  2. B

    &a

  3. C

    a

  4. D

    p

  5. E

    *p

  6. F

    &p

Show answer

Correct answers

  • C

    a

  • E

    *p

Question 22

+4 marksOne or more correct options
Figure from the original question paper

Select all that apply.

  1. A
    Figure from the original question paper
  2. B
    Figure from the original question paper
  3. C
    Figure from the original question paper
  4. D
    Figure from the original question paper
Show answer

Correct answers

  • B
    Figure from the original question paper
  • D
    Figure from the original question paper

Question 23

+4 marksOne or more correct options
Figure from the original question paper

Select all that apply.

  1. A
    Figure from the original question paper
  2. B
    Figure from the original question paper
  3. C
    Figure from the original question paper
  4. D
    Figure from the original question paper
Show answer

Correct answers

  • A
    Figure from the original question paper
  • C
    Figure from the original question paper

Question 24

+4 marksOne or more correct options
Figure from the original question paper

Select all that apply.

  1. A

    The function allocates the memory for a 2D array at the time of compilation.

  2. B

    The function dynamically allocates the memory for a 2D array.

  3. C

    The function does not initialize the elements of the 2D array.

  4. D

    The function initializes all the elements of the 2D array with 0.

Show answer

Correct answers

  • B

    The function dynamically allocates the memory for a 2D array.

  • D

    The function initializes all the elements of the 2D array with 0.

Question 25

+4 marksWritten answer
Figure from the original question paper
Show answer

A written answer, not marked automatically.

Question 26

+4 marksWritten answer

Note: The answer must be an integer. For Ex: If the answer is 32, you must enter 32 only.

Note: The answer must be an integer. For Ex: If the answer is 32, you must enter 32 only.
Show answer

A written answer, not marked automatically.