uiz Space

January 2025 term · Introduction to C Programming · CS1101

Introduction to C Programming Qualifier: 16 March 2025 (January 2025 term)

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.

Questions
16
Marks
50
Duration
120 min
MCQ
11
MSQ
2
Numerical
3

Updated

Official paper: IIT M ES QUALIFIER AN EXAM QEQ1 16 Mar 2025 · No negative marking.

Question 1

+2 marksOne correct option

What does the term "ROM" stand for in computer memory architecture?

  1. A

    Random Only Module

  2. B

    Read Over Memory

  3. C

    Random Only Memory

  4. D

    Read Only Memory

Show answer

Correct answer

  • D

    Read Only Memory

Question 2

+2 marksOne correct option

Which of the following is used to terminate a C statement?

  1. A

    Period (.)

  2. B

    Colon (:)

  3. C

    Comma (,)

  4. D

    Semicolon (;)

Show answer

Correct answer

  • D

    Semicolon (;)

Question 3

+4 marksOne correct option

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?

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

Correct answer

  • C

Question 4

+4 marksOne correct option

The 8-bit binary representation of decimal number -39 in 2's complement notation is __.

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

Correct answer

  • C

Question 5

+4 marksOne correct option

Consider the following code.

c
#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?

  1. A

    Calculates the sum of all factors of input integer n (excluding 1 and n).

  2. B

    Calculates the sum of all non-factors of input integer n between 1 and n.

  3. C

    Calculates the sum of all odd value factors of input integer n (excluding 1 and n).

  4. D

    Calculates the sum of all even value factors of input integer n (excluding 1 and n).

Show answer

Correct answer

  • A

    Calculates the sum of all factors of input integer n (excluding 1 and n).

Question 6

+3 marksOne correct option

Find the decimal equivalent for the unsigned binary representation (11101110)2.

  1. A

    213

  2. B

    243

  3. C

    233

  4. D

    238

Show answer

Correct answer

  • D

    238

Question 7

+3 marksOne correct option

How many maximum unique characters can be encoded using 7 bits?

  1. A

    128 characters

  2. B

    127 characters

  3. C

    64 characters

  4. D

    63 characters

Show answer

Correct answer

  • A

    128 characters

Question 8

+3 marksOne correct option

Consider a decimal number 201. What is the 8 bit binary value of it?

  1. A

    1100 1101

  2. B

    1101 1001

  3. C

    1001 1101

  4. D

    1100 1001

Show answer

Correct answer

  • D

    1100 1001

Question 9

+3 marksOne correct option
  1. A

    x = 3, y = 4, z = 0

  2. B

    x = 3, y = 4, z = 1

  3. C

    x = 3, y = 5, z = 0

  4. D

    x = 3, y = 5, z = 1

Show answer

Correct answer

  • B

    x = 3, y = 4, z = 1

Question 10

+3 marksOne correct option

Which of the following is the correct syntax for a switch statement in C?

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

Correct answer

  • B

Question 11

+3 marksOne correct option

Consider the below C program.

c
#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?

  1. A

    5

  2. B

    10

  3. C

    15

  4. D

    20

Show answer

Correct answer

  • C

    15

Question 12

+2 marksOne or more correct options

Which of the following is/are the component(s) of a computer CPU?

Select all that apply.

  1. A

    ALU

  2. B

    Operating System

  3. C

    Registers

  4. D

    RAM

Show answer

Correct answers

  • A

    ALU

  • C

    Registers

Question 13

+3 marksOne or more correct options

Which of the following is/are valid identifier(s) in C?

Select all that apply.

  1. A

    2nd_var

  2. B

    _secondVar

  3. C

    Var_2

  4. D

    float

  5. E

    discount_in_%

Show answer

Correct answers

  • B

    _secondVar

  • C

    Var_2

Question 14

+4 marksNumerical answer

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?

Show answer

Correct answer: 25

Question 15

+4 marksNumerical answer

Consider the following code snippet.

c
#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?

Show answer

Correct answer: 24

Question 16

+3 marksNumerical answer
Show answer

Correct answer: 20