MauryaHub PYQ Practice

cs3005_2023T3_Q1_NA.pdf

Programming in C · Quiz 1 · Sep 2023

← Course papers · Start practice / exam

This page contains the reliably extracted subset, not the complete original paper.

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

Question 128 MSQ · 2.0 marks

Which of the following is/are **false** statement(s) regarding C programming language?
  1. It is an imperative programming language.
  2. It is not a structured programming language.
  3. It is a dynamically typed programming language.
  4. The language uses curly braces ({ }) to define the scope of a for loop.

A published solution is not available for this question yet.

Question 129 MSQ · 2.0 marks

Which of the following statement(s) is/are **true** regarding ASCII and Unicode?
  1. Unicode is a character set.
  2. ASCII uses 6 bits to encode a given character.
  3. UTF-16 and UTF-32 are both variable length encoding techniques.
  4. UTF-8 is a fixed length encoding technique.

A published solution is not available for this question yet.

Question 130 MSQ · 2.0 marks

Which of the following is/are **valid** identifiers in C language?
  1. 123var
  2. _myVar
  3. my-var
  4. Var_123
  5. myVar!

A published solution is not available for this question yet.

Question 131 MCQ · 2.0 marks

In split memory architecture, what is the purpose of cache memory?
  1. To store the operating system
  2. To provide the permanent storage
  3. To temporarily store frequently used data for fast access
  4. To control the input/output devices

A published solution is not available for this question yet.

Question 132 MCQ · 2.0 marks

What is the primary function of the Program Counter in a CPU?
  1. Execute arithmetic operations
  2. Keep track of the currently executing instruction
  3. To control the input/output devices
  4. Manage memory access

A published solution is not available for this question yet.

Question 133 MCQ · 2.0 marks

Suppose you have a document which contains 58 unique characters. What is the minimum number of bits required to encode a single character in this document?
  1. 2\(^{6}\)
  2. 6
  3. 2\(^{7}\)
  4. 7

A published solution is not available for this question yet.

Question 134 MCQ · 2.0 marks

Consider the following equation: [[IMAGE:f4a68391db3da5df_5_1]] If all the variables are float, which of the following is a correct way to write the given equation in C language?
Source diagram or notation
  1. [[IMAGE:f4a68391db3da5df_5_2]]
    Source diagram or notation
  2. [[IMAGE:f4a68391db3da5df_5_3]]
    Source diagram or notation
  3. [[IMAGE:f4a68391db3da5df_6_4]]
    Source diagram or notation
  4. [[IMAGE:f4a68391db3da5df_6_5]]
    Source diagram or notation

A published solution is not available for this question yet.

Question 135 MCQ · 4.0 marks

Consider the following steps to compute the **minimum** among three numbers. Load the three numbers from memory locations M[0], M[1] and M[2] and store the maximum number in M[3]. [[IMAGE:f4a68391db3da5df_6_6]] Identify the appropriate instructions to fill the blank at step 4 and step 6.
Source diagram or notation
  1. Step 4: If R[0] < R[1] then go to step 5, otherwise go to step 6 Step 6: If R[1] < R[2] then go to step 7, otherwise go to step 8
  2. Step 4: If R[0] > R[1] then go to step 5, otherwise go to step 6 Step 6: If R[1] < R[2] then go to step 7, otherwise go to step 8
  3. Step 4: If R[0] < R[1] then go to step 5, otherwise go to step 6 Step 6: If R[1] > R[2] then go to step 7, otherwise go to step 8
  4. Step 4: If R[0] > R[1] then go to step 5, otherwise go to step 6 Step 6: If R[1] > R[2] then go to step 7, otherwise go to step 8

A published solution is not available for this question yet.

Question 136 MCQ · 4.0 marks

Consider the below C program. [[IMAGE:f4a68391db3da5df_7_7]] The above C program is used to calculate the sum of individual digits of a number. For ex: If the value given to the variable “n” is 25, the sum of individual digits will be 7. Fill in the placeholders “Expression1” and “Expression2” to ensure that the program functions correctly.
Source diagram or notation
  1. Expression1: r = n % 10; Expression2: n = r;
  2. Expression1: r = n / 10; Expression2: n = n % 10;
  3. Expression1: r = n % 10; Expression2: n = n / 10;
  4. Expression1: n = n % 10; Expression2: r = n;

A published solution is not available for this question yet.

Question 137 MCQ · 3.0 marks

Compute the 9-bit binary representation of the decimal number 468.
  1. 011101010
  2. 111010100
  3. 011101001
  4. 111010010

A published solution is not available for this question yet.

Question 138 MCQ · 3.0 marks

Find the 8-bit binary representation of (− 50)10 using 2’s complement notation.
  1. (11001111)2
  2. (11000111)2
  3. (11000110)2
  4. (11001110)2

A published solution is not available for this question yet.

Question 139 MCQ · 3.0 marks

(764)10 = (________)8 Identify the appropriate option to fill in the above blank.
  1. 1271
  2. 1364
  3. 1374
  4. 1274

A published solution is not available for this question yet.

Question 140 MCQ · 3.0 marks

Given two integer variables, x and y, which of the following expressions ensures that both x and y are distinct positive integers if the expression returns 1?
  1. [[IMAGE:f4a68391db3da5df_10_8]]
    Source diagram or notation
  2. [[IMAGE:f4a68391db3da5df_10_9]]
    Source diagram or notation
  3. [[IMAGE:f4a68391db3da5df_10_10]]
    Source diagram or notation
  4. [[IMAGE:f4a68391db3da5df_10_11]]
    Source diagram or notation

A published solution is not available for this question yet.

Question 141 MCQ · 3.0 marks

Consider the following code snippet. [[IMAGE:f4a68391db3da5df_10_12]] What will be the value of x, y and z after executing the given code snippet?
Source diagram or notation
  1. x = 2, y = 4, z = 1
  2. x = 2, y = 4, z = 0
  3. x = 2, y = 3, z = 1
  4. x = 2, y = 3, z = 0

A published solution is not available for this question yet.

Question 142 MCQ · 3.0 marks

Consider the below C program. [[IMAGE:f4a68391db3da5df_11_13]] What will be the output of above given code?
Source diagram or notation
  1. Equal
  2. Not Equal
  3. Compilation error
  4. Runtime error

A published solution is not available for this question yet.

Question 143 MCQ · 3.0 marks

Consider the below C program. [[IMAGE:f4a68391db3da5df_12_14]] What would be the output of the given code?
Source diagram or notation
  1. 8
  2. 3
  3. 0
  4. 4

A published solution is not available for this question yet.

Question 144 NAT · 3.0 marks

Consider the following assembly program (assume anything after “;” is a comment). [[IMAGE:f4a68391db3da5df_13_15]] What will be the final value stored in register R2? Note: The answer input must be an integer. For Ex: If the answer is 32, you must enter 32 only.
Source diagram or notation

    A published solution is not available for this question yet.

    Question 145 NAT · 4.0 marks

    Consider the below C program. [[IMAGE:f4a68391db3da5df_14_16]] What would be the output of the given code? Note: The answer input must be an integer. For Ex: If the answer is 32, you must enter 32 only.
    Source diagram or notation

      A published solution is not available for this question yet.