MauryaHub PYQ Practice

cs3005_2025T3_ET_FN.pdf

Programming in C · End Term · Sep 2025 FN

← 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 MSQ · 3.0 marks

Which of the following statements are true about the switch statement in C?
  1. default case is compulsory in every switch.
  2. Multiple case labels can share the same code block.
  3. break is optional in a switch case.
  4. A switch can be written inside another switch.

A published solution is not available for this question yet.

Question 3 MCQ · 4.0 marks

What will be the output of the following program? [[IMAGE:31fd59dfd8ed3630_2_2]]
Source diagram or notation
  1. z = 19
  2. z = 11
  3. z = 0
  4. z = 5

A published solution is not available for this question yet.

Question 4 MCQ · 5.0 marks

What will be the output of the following program? [[IMAGE:31fd59dfd8ed3630_3_3]]
Source diagram or notation
  1. 1 3 5 7
  2. 1 3 3 5 7
  3. 1 3 5
  4. 1 9 3

A published solution is not available for this question yet.

Question 5 MCQ · 5.0 marks

What will be the output of the following program? [[IMAGE:31fd59dfd8ed3630_4_4]]
Source diagram or notation
  1. Inside: a = 7, b = 3 Outside: x = 3, y = 7
  2. Inside: a = 7, b = 3 Outside: x = 7, y = 3
  3. Inside: a = 3, b = 7 Outside: x = 7, y = 3
  4. Inside: a = 3, b = 7 Outside: x = 3, y = 7

A published solution is not available for this question yet.

Question 6 MCQ · 4.0 marks

Consider the following program. [[IMAGE:31fd59dfd8ed3630_5_5]] Assuming each function must complete before its result is used in the next function call, in which sequence are the functions executed?
Source diagram or notation
  1. main → sub → sub → divi → printf
  2. main → printf → sub → sub → divi
  3. main → divi → sub → sub → printf
  4. main → sub → divi → sub → printf

A published solution is not available for this question yet.

Question 7 MSQ · 3.0 marks

Which of the following is **true** about recursion in C?
  1. Every recursive function must have a base case.
  2. Recursive functions are always faster than iterative ones.
  3. Recursion always leads to infinite calls.
  4. A recursive function can call itself directly or indirectly.

A published solution is not available for this question yet.

Question 8 MCQ · 3.0 marks

Which of the following correctly declares and initializes a pointer to a float variable f?
  1. [[IMAGE:31fd59dfd8ed3630_6_6]]
    Source diagram or notation
  2. [[IMAGE:31fd59dfd8ed3630_6_7]]
    Source diagram or notation
  3. [[IMAGE:31fd59dfd8ed3630_6_8]]
    Source diagram or notation
  4. [[IMAGE:31fd59dfd8ed3630_6_9]]
    Source diagram or notation

A published solution is not available for this question yet.

Question 9 MCQ · 4.0 marks

What will be the output of the following program? [[IMAGE:31fd59dfd8ed3630_6_10]]
Source diagram or notation
  1. Hello
  2. World
  3. o World
  4. ello World

A published solution is not available for this question yet.

Question 10 NAT · 5.0 marks

What will be the output of the following program? [[IMAGE:31fd59dfd8ed3630_7_11]]
Source diagram or notation

    A published solution is not available for this question yet.

    Question 11 MSQ · 5.0 marks

    Consider the following program. [[IMAGE:31fd59dfd8ed3630_8_12]] If the output is 450, which of the following lines could replace the missing statement?
    Source diagram or notation
    1. [[IMAGE:31fd59dfd8ed3630_8_13]]
      Source diagram or notation
    2. [[IMAGE:31fd59dfd8ed3630_8_14]]
      Source diagram or notation
    3. [[IMAGE:31fd59dfd8ed3630_8_15]]
      Source diagram or notation
    4. [[IMAGE:31fd59dfd8ed3630_8_16]]
      Source diagram or notation

    A published solution is not available for this question yet.

    Question 12 MCQ · 3.0 marks

    Which operator is used in C for dynamic memory deallocation?
    1. free()
    2. delete
    3. remove()
    4. dispose()

    A published solution is not available for this question yet.

    Question 13 MCQ · 4.0 marks

    What will be the output of the following program? [[IMAGE:31fd59dfd8ed3630_9_17]]
    Source diagram or notation
    1. 5
    2. 4
    3. 0
    4. 1

    A published solution is not available for this question yet.

    Question 14 MCQ · 5.0 marks

    What will be the output of the following program? [[IMAGE:31fd59dfd8ed3630_9_18]]
    Source diagram or notation
    1. 20
    2. 30
    3. 99
    4. Garbage Value

    A published solution is not available for this question yet.

    Question 15 MSQ · 5.0 marks

    Which of the following are valid storage classes in C?
    1. auto
    2. static
    3. volatile
    4. extern

    A published solution is not available for this question yet.

    Question 16 MCQ · 3.0 marks

    What will be the output of the following program? [[IMAGE:31fd59dfd8ed3630_10_19]]
    Source diagram or notation
    1. 3
    2. 5
    3. 6
    4. 7

    A published solution is not available for this question yet.

    Question 17 NAT · 4.0 marks

    What will be the output of the following program? [[IMAGE:31fd59dfd8ed3630_11_20]]
    Source diagram or notation

      A published solution is not available for this question yet.

      Question 18 MCQ · 3.0 marks

      Which keyword in C prevents a variable from being modified after initialization?
      1. restrict
      2. volatile
      3. const
      4. static

      A published solution is not available for this question yet.

      Question 19 MCQ · 5.0 marks

      What will be the output of the following program? [[IMAGE:31fd59dfd8ed3630_12_21]]
      Source diagram or notation
      1. 5 5 5
      2. 5 6 7
      3. 7 7 7
      4. 10 11 11

      A published solution is not available for this question yet.

      Question 20 MCQ · 4.0 marks

      What will be the output of the following program? [[IMAGE:31fd59dfd8ed3630_13_22]]
      Source diagram or notation
      1. a P
      2. a r
      3. a e
      4. e p

      A published solution is not available for this question yet.

      Question 21 MSQ · 3.0 marks

      Which of the following are valid file handling modes in C?
      1. "rb"
      2. "wx"
      3. "a+"
      4. "r+"

      A published solution is not available for this question yet.

      Question 22 MCQ · 5.0 marks

      Consider the following program. [[IMAGE:31fd59dfd8ed3630_14_23]] If data.txt is empty before execution, what will be printed?
      Source diagram or notation
      1. Nothing
      2. H
      3. e
      4. Error

      A published solution is not available for this question yet.

      Question 23 MCQ · 4.0 marks

      What will be the output of the following program? [[IMAGE:31fd59dfd8ed3630_15_24]]
      Source diagram or notation
      1. B
      2. A
      3. F
      4. 0

      A published solution is not available for this question yet.

      Question 24 MCQ · 3.0 marks

      In macros, which operator is used to substitute the actual argument as a string?
      1. [[IMAGE:31fd59dfd8ed3630_15_25]]
        Source diagram or notation
      2. [[IMAGE:31fd59dfd8ed3630_15_26]]
        Source diagram or notation
      3. [[IMAGE:31fd59dfd8ed3630_15_27]]
        Source diagram or notation
      4. [[IMAGE:31fd59dfd8ed3630_15_28]]
        Source diagram or notation

      A published solution is not available for this question yet.

      Question 25 NAT · 4.0 marks

      What will be the output of the following program? [[IMAGE:31fd59dfd8ed3630_16_29]]
      Source diagram or notation

        A published solution is not available for this question yet.

        Question 26 MCQ · 4.0 marks

        What will be the output of the following program? [[IMAGE:31fd59dfd8ed3630_16_30]]
        Source diagram or notation
        1. 5
        2. 4
        3. 20
        4. Compiler error

        A published solution is not available for this question yet.