uiz Space

January 2024 term · Programming in C · BSCS3005

Programming in C Quiz 1: 25 February 2024 (January 2024 term)

The IIT Madras BS Programming in C (Programming in C) Quiz 1 paper sat on 25 Feb 2024, in the January 2024 term: 16 questions for 50 marks in 120 minutes. Every question is below with its answer. Take it as a timed mock test to be marked, or read it through first.

Questions
16
Marks
50
Duration
120 min
MCQ
12
Numerical
3
MSQ
1

Updated

Official paper: IIT M DEGREE AN2 EXAM QDB2 25 Feb 2024 · No negative marking.

Question 1

+2 marksOne correct option

Which of the following components temporarily stores data and instructions that are frequently requested?

  1. A

    ALU (Arithmetic Logic Unit)

  2. B

    Cache Memory

  3. C

    Control Unit

  4. D

    RAM

Show answer

Correct answer

  • B

    Cache Memory

Question 2

+2 marksOne correct option

Which type of memory is typically used for storage of BIOS (Basic Input/Output System) firmware in a computer?

  1. A

    Cache Memory

  2. B

    RAM (Random Access Memory)

  3. C

    ROM (Read-Only Memory)

  4. D

    Registers

Show answer

Correct answer

  • C

    ROM (Read-Only Memory)

Question 3

+3 marksOne correct option

Select the correct statement about peripherals in a computer.

  1. A

    CPU reads the values from the peripherals by reading the value at the memory address mapped to them.

  2. B

    CPU has separate instructions for performing read and write from a peripheral.

  3. C

    CPU cannot read the values from the peripherals

  4. D

    There is a standard and fixed memory mappings for each input device.

Show answer

Correct answer

  • A

    CPU reads the values from the peripherals by reading the value at the memory address mapped to them.

Question 4

+3 marksOne correct option

Consider the signed integer -4 is represented with 4 bits in signed magnitude form. If the same 4 bits are interpreted as an unsigned integer, what will be the value of the unsigned integer in decimal?

  1. A

    4

  2. B

    14

  3. C

    12

  4. D

    5

Show answer

Correct answer

  • C

    12

Question 5

+3 marksOne correct option

The number of '1's present in the binary form of the hexadecimal number 0xE5F7 is ___?

  1. A

    4

  2. B

    8

  3. C

    12

  4. D

    16

Show answer

Correct answer

  • C

    12

Question 6

+3 marksOne correct option

Assume the digits from 0 to 9 are encoded as characters. The even digits are mapped from 0 to 4 in ascending order, and the odd digits are mapped from 5 to 9 in the descending order. What is the mapping for the digit "7" with respect to the above encoding?

  1. A

    4

  2. B

    6

  3. C

    7

  4. D

    8

Show answer

Correct answer

  • B

    6

Question 7

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

Correct answer

  • C

Question 8

+3 marksOne correct option

Select the correct statement about the sizes of the different data types in C.

  1. A

    sizeof(char) >= sizeof(double)

  2. B

    sizeof(int) >= sizeof(float)

  3. C

    sizeof(double) >= sizeof(float)

  4. D

    sizeof(short) >= sizeof(int)

Show answer

Correct answer

  • C

    sizeof(double) >= sizeof(float)

Question 9

+3 marksOne correct option

Select the snippet that will generate the output "12345".

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

Correct answer

  • D

Question 10

+4 marksOne correct option
  1. A

    If (R[1] >= 0), go to Step 3

  2. B

    If (R[1] > 0), go to Step 3

  3. C

    If (R[1] >= 0), go to Step 7

  4. D

    If (R[1] > 0), go to Step 7

Show answer

Correct answer

  • B

    If (R[1] > 0), go to Step 3

Question 11

+4 marksOne correct option
  1. A

    8

  2. B

    18

  3. C

    14

  4. D

    10

Show answer

Correct answer

  • B

    18

Question 12

+3 marksNumerical answer

What is the minimum number of bits required to represent the character set with uppercase and lowercase alphabets, the digits from 0 to 9, space, comma and full stop?

Show answer

Correct answer: 6

Question 13

+3 marksOne correct option

Based on the above data, answer the given subquestions.

If a = 0 and the output of the given program is 'A', then what can be the possible values of b and c?

  1. A

    b = 0, c = 0

  2. B

    b = 0, c = 1

  3. C

    b = 1, c = 0

  4. D

    b = 1, c = 1

Show answer

Correct answer

  • C

    b = 1, c = 0

Question 14

+4 marksOne or more correct options

Based on the above data, answer the given subquestions.

If a, b, and c could only take the values 0 or 1, select all the statements that are correct.

Select all that apply.

  1. A

    If the output of the program is '2' and b=0, then the value of c is 1.

  2. B

    If the output of the program is '2' and b=0, then the value of c is 0.

  3. C

    If the value of c is 0, then the output cannot be '1' for any values of a and b.

  4. D

    If the value of b is 0, then the output cannot be '1' for any values of a and c.

Show answer

Correct answers

  • B

    If the output of the program is '2' and b=0, then the value of c is 0.

  • C

    If the value of c is 0, then the output cannot be '1' for any values of a and b.

Question 15

+3 marksNumerical answer

Based on the above data, answer the given subquestions.

If the value of b is 9, then what will be the output of the given program?

Show answer

Correct answer: 19

Question 16

+4 marksNumerical answer

Based on the above data, answer the given subquestions.

If the value of b is 10, then what will be the output of the given program?

Show answer

Correct answer: 22