MauryaHub PYQ Practice

cs3005_2026T2_Q1_NA.pdf

Programming in C · Quiz 1 · May 2026

← Course papers · Start practice / exam

Questions and published explanations below are available without starting a test. Some questions may not have a published solution yet.

Question 2 MCQ · 2.0 marks

Which of the following best characterizes the C programming language?
  1. High-level, object-oriented, interpreted
  2. High-level, unstructured, compiled
  3. Mid-level, structured, compiled
  4. Low-level, procedural, interpreted

A published solution is not available for this question yet.

Question 3 MCQ · 2.0 marks

What is the decimal equivalent of the hexadecimal number **3D**?
  1. 51
  2. 63
  3. 61
  4. 77

A published solution is not available for this question yet.

Question 4 MCQ · 2.0 marks

What is the range of integer values that can be represented by an **8-bit signed integer** using **two's complement convention**?
  1. -127 to +127
  2. -128 to +127
  3. -255 to +255
  4. 0 to 255

A published solution is not available for this question yet.

Question 5 MCQ · 2.0 marks

What is the purpose of the Program Counter (PC) in a CPU?
  1. It performs arithmetic and logic operations.
  2. It holds the address of the next instruction to be executed.
  3. It stores temporary data for quick access.
  4. It coordinates the flow of data between the CPU and memory.

A published solution is not available for this question yet.

Question 6 MCQ · 4.0 marks

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. (x - y) * (x - y - 1)
  2. (x - y) * (2x - y)
  3. (x - y) * (x - 2y)
  4. (x - y) * (x - y)

A published solution is not available for this question yet.

Question 7 MCQ · 4.0 marks

What will be the output of the following code? [[IMAGE:69c15897ca78adf5_4_2]]
Source diagram or notation
  1. 011334
  2. 0134
  3. 012123234
  4. 0112334

A published solution is not available for this question yet.

Question 8 MCQ · 4.0 marks

What will be the output of the following code? [[IMAGE:69c15897ca78adf5_5_3]]
Source diagram or notation
  1. 1 2 3 4 5 6 7 8 9
  2. 1 2 7 8
  3. 1 2 3 7 8
  4. 1 2 3 7 8 9

A published solution is not available for this question yet.

Question 9 MCQ · 3.0 marks

Trace the computation of the following C program fragment: [[IMAGE:69c15897ca78adf5_5_4]] What are the final values of a, b, and c?
Source diagram or notation
  1. a = 1, b = 18, c = 24
  2. a = 7, b = 15, c = 21
  3. a = 10, b = 18, c = 24
  4. a = 8, b = 15, c = 22

A published solution is not available for this question yet.

Question 10 MCQ · 3.0 marks

Consider the following C code. [[IMAGE:69c15897ca78adf5_6_5]] What will be the output?
Source diagram or notation
  1. 5
  2. 12
  3. 9
  4. 10

A published solution is not available for this question yet.

Question 11 NAT · 3.0 marks

Consider the nested ternary expression: [[IMAGE:69c15897ca78adf5_6_6]] What is the value of b after execution?
Source diagram or notation

    A published solution is not available for this question yet.

    Question 12 NAT · 3.0 marks

    What will be the output of the following code? [[IMAGE:69c15897ca78adf5_7_7]]
    Source diagram or notation

      A published solution is not available for this question yet.

      Question 13 NAT · 2.0 marks

      What is the value of the integer variable **result** after executing the following C statement? [[IMAGE:69c15897ca78adf5_8_8]]
      Source diagram or notation

        A published solution is not available for this question yet.

        Question 14 MSQ · 3.0 marks

        Which of the following **CANNOT** be used as **valid** variable names in C?
        1. total_marks
        2. 1st_score
        3. _final_value
        4. if
        5. price$

        A published solution is not available for this question yet.

        Question 15 MSQ · 3.0 marks

        Which of the following statements about C's logical operators '&&' (AND) and '||' (OR) are correct, specifically regarding their short-circuit behavior?
        1. The expression (A && B) always evaluates B if A is true.
        2. The expression (A || B) always evaluates B if A is true.
        3. If the first operand of '&&' is false, the second operand is not evaluated.
        4. If the first operand of '||' is true, the second operand is not evaluated.

        A published solution is not available for this question yet.

        Question 16 MSQ · 2.0 marks

        Consider the following C program: [[IMAGE:69c15897ca78adf5_9_9]] Which of the following statements about the output are true?
        Source diagram or notation
        1. If the input is x = 5, y = 6, the output is R
        2. If the input is x = -1, y = 15, the output is V
        3. If the input is x = 0, y = 12, the output is U
        4. If the input is x = 1, y = 7, the output is R
        5. If the input is x = 0, y = 5, the output is U

        A published solution is not available for this question yet.

        Question 17 NAT · 4.0 marks

        Consider the following generalized computation: Step 1: R0 ← M[0] Step 2: R1 ← M[1] Step 3: R3 ← R0 MOD 2 Step 4: IF R3 = 0 THEN GOTO Step 7, Otherwise GOTO Step 5 Step 5: R2 = R0 + R1 Step 6: GOTO Step 8 Step 7: R2 = R0 * R1 Step 8: M[2] ← R2 If M[0] = 5 and M[1] = 3, what is the value of M[2] at the end of the computation?

          A published solution is not available for this question yet.

          Question 18 NAT · 4.0 marks

          Consider the following assembly program (anything after ; is a comment). [[IMAGE:69c15897ca78adf5_11_10]] If initially n=6, what will be the final value stored in R2 at the end of the program?
          Source diagram or notation

            A published solution is not available for this question yet.