uiz Space

January 2025 term · Introduction to C Programming · CS1101

Introduction to C Programming Qualifier: 13 April 2025 (January 2025 term)

The IIT Madras BS Introduction to C Programming (Intro to C Programming) Qualifier paper sat on 13 Apr 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.

Questions
16
Marks
50
Duration
120 min
MCQ
11
MSQ
1
Numerical
4

Updated

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

Question 1

+3 marksOne correct option

The main purpose of cache memory is to:

  1. A

    Store data permanently.

  2. B

    Reduce the burden on the ALU.

  3. C

    Speed up access to frequently used data and instructions.

  4. D

    Manage memory allocation between processes.

Show answer

Correct answer

  • C

    Speed up access to frequently used data and instructions.

Question 2

+3 marksOne correct option

Identify the option that arranges the following memory types in descending order of size (from largest to smallest).

  1. A

    Secondary Memory (Hard Drive), Main Memory (RAM), Cache Memory, Registers

  2. B

    Main Memory (RAM), Secondary Memory (Hard Drive), Registers, Cache Memory

  3. C

    Main Memory (RAM), Secondary Memory (Hard Drive), Cache Memory, Registers

  4. D

    Secondary Memory (Hard Drive), Registers, Main Memory (RAM), Cache Memory

Show answer

Correct answer

  • A

    Secondary Memory (Hard Drive), Main Memory (RAM), Cache Memory, Registers

Question 3

+3 marksOne correct option

What is the minimum number of bits required for binary representation of (1912)10?

  1. A

    9

  2. B

    10

  3. C

    11

  4. D

    12

Show answer

Correct answer

  • C

    11

Question 4

+3 marksOne correct option

What is the decimal equivalents for the binary number 10011011?

  1. A

    155

  2. B

    153

  3. C

    154

  4. D

    160

Show answer

Correct answer

  • A

    155

Question 5

+3 marksOne correct option

What is the sum of the hexadecimal numbers AB, 3C and 4F as a decimal number?

  1. A

    270

  2. B

    140

  3. C

    310

  4. D

    80

Show answer

Correct answer

  • C

    310

Question 6

+3 marksOne correct option

The 16-bit binary representation of decimal number “-256” in 2's complement notation is__.

  1. A

    11111111 00000000

  2. B

    11111000 00000000

  3. C

    11111111 11111000

  4. D

    10000000 00000000

Show answer

Correct answer

  • A

    11111111 00000000

Question 7

+3 marksOne correct option

Consider the following code snippet.

What will be the value of x, y and z after executing the given code snippet?

  1. A

    x = 0, y = 4, z = 0

  2. B

    x = 1, y = 4, z = 1

  3. C

    x = 1, y = 3, z = 1

  4. D

    x = 0, y = 3, z = 0

Show answer

Correct answer

  • D

    x = 0, y = 3, z = 0

Question 8

+3 marksOne correct option

Which of the following statements correctly declares and initializes an integer variable named age in C?

  1. A

    int age = 25;

  2. B

    age = 25;

  3. C

    int *age = 25;

  4. D

    age = int(25);

Show answer

Correct answer

  • A

    int age = 25;

Question 9

+3 marksOne correct option

Shree is writing a program to calculate the product of the first 10 multiples of 4. He has written a code, but one statement is missing.

c
int i = 4;
int product = 1;
while(i <= 40)
{
product = product * i;
---- missing statement ----
}
printf("%d",product);
  1. A

    i = i * 4

  2. B

    i = i + 1

  3. C

    i = i + 4

  4. D

    i = 4

Show answer

Correct answer

  • C

    i = i + 4

Question 10

+3 marksOne correct option

Which of the following special symbols is allowed in a variable name?

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

Correct answer

  • D

Question 11

+4 marksOne correct option

What will be the output if the user enters x = 4 and y = 10 in the following program?

c
#include <stdio.h>
int main() {
int x, y;
scanf("%d %d", &x, &y);
if (x >= 5) {
if (y < 10)
printf("Case 1");
else
printf("Case 2");
} else {
if (y == 10)
printf("Case 3");
else
printf("Case 4");
}
return 0;
}
  1. A

    Case 1

  2. B

    Case 2

  3. C

    Case 3

  4. D

    Case 4

Show answer

Correct answer

  • C

    Case 3

Question 12

+4 marksOne or more correct options

Consider the following equation:

If all the variables are float, which of the following is a correct way to write the given equation in C language?

Select all that apply.

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

Correct answers

  • A
  • D

Question 13

+3 marksNumerical answer

Consider the computations given below using the generalized memory model.
1. M[0] ← 7
2. M[1] ← 5
3. M[1] ← M[1] * M[1]
4. M[0] ← M[1] - M[0]
5. M[1] ← M[1] - M[0]
6. M[0] ← M[1] + M[0]
7. M[2] ← M[0]
What is the value of M[2] at the end of the computation?

Show answer

Correct answer: 25

Question 14

+3 marksNumerical answer

Consider the computations given below using the generalized memory model.

  1. R[0]←5R[0] \leftarrow 5
  2. R[1]←3R[1] \leftarrow 3
  3. R[2]←7R[2] \leftarrow 7
  4. If R[0]<R[1]R[0] < R[1] then go to step 5, otherwise go to step 6
  5. R[1]=R[0]R[1] = R[0]
  6. If R[1]<R[2]R[1] < R[2] then go to step 7, otherwise go to step 8
  7. R[2]=R[1]R[2] = R[1]
  8. R[3]=R[2]R[3] = R[2]

What is the value of R[3] at the end of the computation?

Show answer

Correct answer: 3

Question 15

+3 marksNumerical answer

Consider the below code segment

c
#include <stdio.h>
int main()
{
int i = 2, j = 1;
switch(i + j)
{
case 1:
j++;
case 2:
j++;
case 3:
j++;
case 4:
j++;
default:
j++;
}
printf("%d",j);
}

What will be the output of the above program?

Show answer

Correct answer: 4

Question 16

+3 marksNumerical answer

Consider the C program given below.

c
#include <stdio.h>
int main()
{
for(int i=0; i<15; i++)
{
if(i%3==0)
{
continue;
}
printf("Hello\n");
}
return 0;
}

How many times “Hello” gets printed?

Show answer

Correct answer: 10