MauryaHub PYQ Practice

cs3005_2026T1_Q1_NA.pdf

Programming in C · Quiz 1 · Jan 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 · 5.0 marks

What is the decimal equivalent of the following **8-bit signed binary number represented using** **the two’s complement convention**? (11100101)2
  1. -27
  2. -21
  3. -35
  4. 229

A published solution is not available for this question yet.

Question 3 MCQ · 5.0 marks

[[IMAGE:1687b6e47cd9d926_3_2]]
Source diagram or notation
  1. 4
  2. 5
  3. 6
  4. 7

A published solution is not available for this question yet.

Question 4 MCQ · 5.0 marks

[[IMAGE:1687b6e47cd9d926_4_3]]
Source diagram or notation
  1. 8
  2. 4
  3. 5
  4. 6

A published solution is not available for this question yet.

Question 5 MCQ · 5.0 marks

Consider the following C program: [[IMAGE:1687b6e47cd9d926_4_4]] What will be the output?
Source diagram or notation
  1. 50
  2. 10
  3. Garbage value
  4. Compilation error

A published solution is not available for this question yet.

Question 6 MCQ · 3.0 marks

Consider the code: [[IMAGE:1687b6e47cd9d926_5_5]] What will be the value of c?
Source diagram or notation
  1. 14
  2. 12
  3. 17
  4. 19

A published solution is not available for this question yet.

Question 7 MCQ · 3.0 marks

What is the correct way to access a structure member using a pointer to a structure?
  1. [[IMAGE:1687b6e47cd9d926_5_6]]
    Source diagram or notation
  2. [[IMAGE:1687b6e47cd9d926_5_7]]
    Source diagram or notation
  3. [[IMAGE:1687b6e47cd9d926_5_8]]
    Source diagram or notation
  4. [[IMAGE:1687b6e47cd9d926_5_9]]
    Source diagram or notation

A published solution is not available for this question yet.

Question 8 MCQ · 3.0 marks

We want to dynamically allocate memory at runtime for **10 integer elements** and store the returned address in a pointer. Which of the following statements is correct?
  1. [[IMAGE:1687b6e47cd9d926_6_10]]
    Source diagram or notation
  2. [[IMAGE:1687b6e47cd9d926_6_11]]
    Source diagram or notation
  3. [[IMAGE:1687b6e47cd9d926_6_12]]
    Source diagram or notation
  4. [[IMAGE:1687b6e47cd9d926_6_13]]
    Source diagram or notation

A published solution is not available for this question yet.

Question 9 MCQ · 3.0 marks

In C preprocessor directives, what does the [[IMAGE:1687b6e47cd9d926_6_14]] operator do when used in macro definitions?
Source diagram or notation
  1. Concatenates two tokens
  2. Compares two tokens
  3. Excludes a token
  4. Multiplies two tokens

A published solution is not available for this question yet.

Question 10 MCQ · 4.0 marks

Consider the following C program: [[IMAGE:1687b6e47cd9d926_7_15]] What will be the output?
Source diagram or notation
  1. 15
  2. 10
  3. 5
  4. Garbage value

A published solution is not available for this question yet.

Question 11 MCQ · 4.0 marks

A 4-byte integer [[IMAGE:1687b6e47cd9d926_7_16]] is stored starting at memory address [[IMAGE:1687b6e47cd9d926_7_17]] . What value will be stored at address [[IMAGE:1687b6e47cd9d926_7_18]] in a **Little-Endian system**?
Source diagram or notationSource diagram or notationSource diagram or notation
  1. [[IMAGE:1687b6e47cd9d926_7_19]]
    Source diagram or notation
  2. [[IMAGE:1687b6e47cd9d926_7_20]]
    Source diagram or notation
  3. [[IMAGE:1687b6e47cd9d926_7_21]]
    Source diagram or notation
  4. [[IMAGE:1687b6e47cd9d926_7_22]]
    Source diagram or notation

A published solution is not available for this question yet.

Question 12 MCQ · 4.0 marks

Consider the following code: [[IMAGE:1687b6e47cd9d926_8_23]] What will be the output?
Source diagram or notation
  1. [[IMAGE:1687b6e47cd9d926_8_24]]
    Source diagram or notation
  2. [[IMAGE:1687b6e47cd9d926_8_25]]
    Source diagram or notation
  3. [[IMAGE:1687b6e47cd9d926_8_26]]
    Source diagram or notation
  4. [[IMAGE:1687b6e47cd9d926_8_27]]
    Source diagram or notation

A published solution is not available for this question yet.

Question 13 MCQ · 4.0 marks

[[IMAGE:1687b6e47cd9d926_8_28]] What will be the output of the given code?
Source diagram or notation
  1. 1 3 4 5
  2. 0 3 3 4
  3. 0 1 2 3
  4. 0 3 4 5

A published solution is not available for this question yet.

Question 14 MCQ · 4.0 marks

[[IMAGE:1687b6e47cd9d926_9_29]]
Source diagram or notation
  1. [[IMAGE:1687b6e47cd9d926_9_30]]
    Source diagram or notation
  2. [[IMAGE:1687b6e47cd9d926_9_31]]
    Source diagram or notation
  3. [[IMAGE:1687b6e47cd9d926_9_32]]
    Source diagram or notation
  4. [[IMAGE:1687b6e47cd9d926_9_33]]
    Source diagram or notation

A published solution is not available for this question yet.

Question 15 MCQ · 4.0 marks

Assume [[IMAGE:1687b6e47cd9d926_9_34]] contains: [[IMAGE:1687b6e47cd9d926_9_35]] Consider the following C code snippet. What will be printed on the screen? [[IMAGE:1687b6e47cd9d926_10_36]]
Source diagram or notationSource diagram or notationSource diagram or notation
  1. [[IMAGE:1687b6e47cd9d926_10_37]]
    Source diagram or notation
  2. [[IMAGE:1687b6e47cd9d926_10_38]]
    Source diagram or notation
  3. [[IMAGE:1687b6e47cd9d926_10_39]]
    Source diagram or notation
  4. [[IMAGE:1687b6e47cd9d926_10_40]]
    Source diagram or notation

A published solution is not available for this question yet.

Question 16 MCQ · 4.0 marks

Consider the C program below. [[IMAGE:1687b6e47cd9d926_10_41]] What will be the output of the above C program?
Source diagram or notation
  1. 63
  2. 45
  3. 27
  4. 14

A published solution is not available for this question yet.

Question 17 MSQ · 5.0 marks

Consider the following C program: [[IMAGE:1687b6e47cd9d926_11_42]] Which of the following statements are correct?
Source diagram or notation
  1. [[IMAGE:1687b6e47cd9d926_11_43]] becomes 12
    Source diagram or notation
  2. [[IMAGE:1687b6e47cd9d926_11_44]] becomes 12
    Source diagram or notation
  3. [[IMAGE:1687b6e47cd9d926_11_45]] and [[IMAGE:1687b6e47cd9d926_11_46]] both point to [[IMAGE:1687b6e47cd9d926_11_47]]
    Source diagram or notationSource diagram or notationSource diagram or notation
  4. [[IMAGE:1687b6e47cd9d926_11_48]] and [[IMAGE:1687b6e47cd9d926_11_49]] both point to [[IMAGE:1687b6e47cd9d926_11_50]]
    Source diagram or notationSource diagram or notationSource diagram or notation

A published solution is not available for this question yet.

Question 18 MSQ · 4.0 marks

Which of the following statements about arrays in C are correct?
  1. Array elements are stored in contiguous memory locations.
  2. Array size can be changed after declaration.
  3. The array name acts like a pointer to the first element in most expressions.
  4. Arrays can store elements of different data types.
  5. Array indexing starts from 0.

A published solution is not available for this question yet.

Question 19 MSQ · 4.0 marks

Which of the following statements about [[IMAGE:1687b6e47cd9d926_12_51]] in C are correct?
Source diagram or notation
  1. Size of the [[IMAGE:1687b6e47cd9d926_12_52]] is equal to the sum of all member sizes
    Source diagram or notation
  2. All members share the same memory location
  3. Each member has its own separate memory
  4. Only one member can hold a valid value at a time

A published solution is not available for this question yet.

Question 20 MSQ · 3.0 marks

Which of the following file modes **delete the existing content of a file when opened**?
  1. "w"
  2. "w+"
  3. "r+"
  4. "a"

A published solution is not available for this question yet.

Question 21 NAT · 5.0 marks

Consider the following computation steps: 1. R[0] = 2 2. R[1] = 3 3. R[1] = R[1] + R[0] 4. R[0] = R[0] + 1 5. If R[0] ≤ 5 go to step-3, otherwise, go to step-6 6. R[2] = R[1] What is the final value of R[2] at the end of computation?

    A published solution is not available for this question yet.

    Question 22 NAT · 5.0 marks

    Consider the following C program: [[IMAGE:1687b6e47cd9d926_13_53]] What will be the **output printed on the screen**?
    Source diagram or notation

      A published solution is not available for this question yet.

      Question 23 NAT · 5.0 marks

      Consider the following C program: [[IMAGE:1687b6e47cd9d926_14_54]] What will be the **output printed on the screen**?
      Source diagram or notation

        A published solution is not available for this question yet.

        Question 24 NAT · 5.0 marks

        Consider the following C code: [[IMAGE:1687b6e47cd9d926_15_55]] What will be the output?
        Source diagram or notation

          A published solution is not available for this question yet.

          Question 25 NAT · 4.0 marks

          Consider the following C code snippet. What will be the output? [[IMAGE:1687b6e47cd9d926_16_56]]
          Source diagram or notation

            A published solution is not available for this question yet.