Question 1
What does the term "ROM" stand for in computer memory architecture?
Random Only Module
Read Over Memory
Random Only Memory
Read Only Memory
The IIT Madras BS Introduction to C Programming (Intro to C Programming) Qualifier paper sat on 16 Mar 2025, in the January 2025 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.
What does the term "ROM" stand for in computer memory architecture?
Random Only Module
Read Over Memory
Random Only Memory
Read Only Memory
Correct answer
Read Only Memory
Which of the following is used to terminate a C statement?
Period (.)
Colon (:)
Comma (,)
Semicolon (;)
Correct answer
Semicolon (;)
Consider the computations given below using the generalized memory model.
1. M[0] ← x
2. M[1] ← y
3. M[2] ← M[0] – M[1]
4. M[1] ← M[2] * M[1]
5. M[0] ← M[2] * M[0]
6. M[2] ← M[0] + M[1]
7. M[3] ← M[2]
What is the value of M[3] at the end of the execution?
Correct answer
The 8-bit binary representation of decimal number -39 in 2's complement notation is __.
Correct answer
Consider the following code.
#include <stdio.h>int main() { int n, i, s = 0; scanf("%d", &n);
for (i = 2; i < n; i++) { if (n % i != 0) { continue; } s += i; }
printf("%d", s); return 0; }Let the input is a positive integer in the given program. What does the code do?
Calculates the sum of all factors of input integer n (excluding 1 and n).
Calculates the sum of all non-factors of input integer n between 1 and n.
Calculates the sum of all odd value factors of input integer n (excluding 1 and n).
Calculates the sum of all even value factors of input integer n (excluding 1 and n).
Correct answer
Calculates the sum of all factors of input integer n (excluding 1 and n).
Find the decimal equivalent for the unsigned binary representation (11101110)2.
213
243
233
238
Correct answer
238
How many maximum unique characters can be encoded using 7 bits?
128 characters
127 characters
64 characters
63 characters
Correct answer
128 characters
Consider a decimal number 201. What is the 8 bit binary value of it?
1100 1101
1101 1001
1001 1101
1100 1001
Correct answer
1100 1001
x = 3, y = 4, z = 0
x = 3, y = 4, z = 1
x = 3, y = 5, z = 0
x = 3, y = 5, z = 1
Correct answer
x = 3, y = 4, z = 1
Which of the following is the correct syntax for a switch statement in C?
Correct answer
Consider the below C program.
#include <stdio.h>
int main() { int a = 10, b = 20; int c = b > a ? b-5 : a+2; printf("%d",c); return 0;}What will be the output of the above program?
5
10
15
20
Correct answer
15
Which of the following is/are the component(s) of a computer CPU?
ALU
Operating System
Registers
RAM
Correct answers
ALU
Registers
Which of the following is/are valid identifier(s) in C?
2nd_var
_secondVar
Var_2
float
discount_in_%
Correct answers
_secondVar
Var_2
Consider the below steps of computations.
1. R[0] = 9
2. R[1] = 0
3. R[1] = R[1] + R[0]
4. R[0] = R[0] - 2
5. If R[0] > 0, go to step-3, otherwise go to step-6
6. R[2] = R[1]
What will be the values of R[2] at the end of the computations?
Correct answer: 25
Consider the following code snippet.
#include <stdio.h>int main() { for (int i = 1; i < 5; i++) { for (int j = 0; j < 6; j++) { printf("Hello C\n"); } } return 0; }How many times will Hello C be printed?
Correct answer: 24
Correct answer: 20