Question 1
Which of the following components temporarily stores data and instructions that are frequently requested?
ALU (Arithmetic Logic Unit)
Cache Memory
Control Unit
RAM

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.
Which of the following components temporarily stores data and instructions that are frequently requested?
ALU (Arithmetic Logic Unit)
Cache Memory
Control Unit
RAM
Correct answer
Cache Memory
Which type of memory is typically used for storage of BIOS (Basic Input/Output System) firmware in a computer?
Cache Memory
RAM (Random Access Memory)
ROM (Read-Only Memory)
Registers
Correct answer
ROM (Read-Only Memory)
Select the correct statement about peripherals in a computer.
CPU reads the values from the peripherals by reading the value at the memory address mapped to them.
CPU has separate instructions for performing read and write from a peripheral.
CPU cannot read the values from the peripherals
There is a standard and fixed memory mappings for each input device.
Correct answer
CPU reads the values from the peripherals by reading the value at the memory address mapped to them.
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?
4
14
12
5
Correct answer
12
The number of '1's present in the binary form of the hexadecimal number 0xE5F7 is ___?
4
8
12
16
Correct answer
12
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?
4
6
7
8
Correct answer
6
Correct answer
Select the correct statement about the sizes of the different data types in C.
sizeof(char) >= sizeof(double)
sizeof(int) >= sizeof(float)
sizeof(double) >= sizeof(float)
sizeof(short) >= sizeof(int)
Correct answer
sizeof(double) >= sizeof(float)
Select the snippet that will generate the output "12345".
Correct answer
If (R[1] >= 0), go to Step 3
If (R[1] > 0), go to Step 3
If (R[1] >= 0), go to Step 7
If (R[1] > 0), go to Step 7
Correct answer
If (R[1] > 0), go to Step 3
8
18
14
10
Correct answer
18
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?
Correct answer: 6
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?
b = 0, c = 0
b = 0, c = 1
b = 1, c = 0
b = 1, c = 1
Correct answer
b = 1, c = 0
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.
If the output of the program is '2' and b=0, then the value of c is 1.
If the output of the program is '2' and b=0, then the value of c is 0.
If the value of c is 0, then the output cannot be '1' for any values of a and b.
If the value of b is 0, then the output cannot be '1' for any values of a and c.
Correct answers
If the output of the program is '2' and b=0, then the value of c is 0.
If the value of c is 0, then the output cannot be '1' for any values of a and b.
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?
Correct answer: 19
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?
Correct answer: 22