MauryaHub PYQ Practice

Programming in C · End Term · May 2024 · FN

Programming in C · End Term · May 2024 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.

0 / 27 published solutions

Question 134 NAT · 3.0 marks

A discrete distribution pdf, f(D), defined as
Source diagram or notation

A published solution is not available for this question yet.

Report a correction for Q134

Question 136 MSQ · 3.0 marks

Which of the following statements is/are true about the if statement in C?
6406533052477.
else if is compulsory to use with if statement.
6406533052478.
else is compulsory to use with if statement.
6406533052479.
else or else if is optional with if statement.
6406533052480.
Multiple else if are allowed with if statement.

A published solution is not available for this question yet.

Report a correction for Q136

Question 137 MCQ · 3.0 marks

Which of the following statements accurately describes the base case in a recursive function in C?
6406533052497.
The base case is the first statement executed within the function.
6406533052498.
The base case is a condition that triggers an infinite call within the function.
6406533052499.
The base case is the condition that ensures the recursive function terminates.
6406533052500.
The base case is the condition when the function calls itself.

A published solution is not available for this question yet.

Report a correction for Q137

Question 138 MCQ · 3.0 marks

Which of the following statements correctly initializes a pointer variable ptr to hold the address of another integer variable var in C?
6406533052501.Source diagram or notation
6406533052502.Source diagram or notation
6406533052503.Source diagram or notation
6406533052504.Source diagram or notation

A published solution is not available for this question yet.

Report a correction for Q138

Question 139 MCQ · 3.0 marks

What character marks the end of a string in C?
6406533052513.
‘*’ (asterisk)
6406533052514.
‘$’ (dollar sign)
6406533052515.
‘\0’ (null terminator)
6406533052516.
‘#’ (hash sign)

A published solution is not available for this question yet.

Report a correction for Q139

Question 140 MCQ · 3.0 marks

Which of the following statement is true about structures and unions in C regarding memory allocation?
6406533052525.
Structures allocate memory based on the sum of all member sizes.
6406533052526.
Unions allocate memory based on the sum of all member sizes.
6406533052527.
Memory is shared between members in the structures.
6406533052528.
Unions and structures allocate memory in the same way.

A published solution is not available for this question yet.

Report a correction for Q140

Question 141 MCQ · 3.0 marks

Which memory region in C programming is used for storing local variables and function parameters?
6406533052542.
Heap memory
6406533052543.
Stack memory
6406533052544.
Code segment
6406533052545.
Global memory

A published solution is not available for this question yet.

Report a correction for Q141

Question 142 MCQ · 3.0 marks

Which function is used to write data to a file in C programming?
6406533052550.
fwrite()
6406533052551.
fput()
6406533052552.
write()
6406533052553.
put()

A published solution is not available for this question yet.

Report a correction for Q142

Question 143 MCQ · 3.0 marks

In C preprocessor directives, what does the ## operator do when used in macro definitions?
6406533052562.
Excludes a token
6406533052563.
Compares two tokens
6406533052564.
Concatenates two tokens
6406533052565.
Multiplies two tokens

A published solution is not available for this question yet.

Report a correction for Q143

Question 144 MCQ · 4.0 marks

Source diagram or notation
6406533052481.
Value of c: 200
6406533052482.
Value of c: 31
6406533052483.
Value of c: -1
6406533052484.
Value of c: 170

A published solution is not available for this question yet.

Report a correction for Q144

Question 145 MCQ · 4.0 marks

Source diagram or notation
6406533052493.
main → sum → sum → prod → printf
6406533052494.
main → printf → sum → sum → prod
6406533052495.
main → printf → prod → sum → sum
6406533052496.
main → prod→ sum → sum → printf

A published solution is not available for this question yet.

Report a correction for Q145

Question 146 MCQ · 4.0 marks

Source diagram or notation
6406533052505.
End Term Exam
6406533052506.
Term
6406533052507.
Term Exam
6406533052508.
erm Exam

A published solution is not available for this question yet.

Report a correction for Q146

Question 147 MCQ · 4.0 marks

Source diagram or notation
6406533052517.
abcdfgh
6406533052518.
abcd fgh
6406533052519.
abcd
6406533052520.
abcd0fgh

A published solution is not available for this question yet.

Report a correction for Q147

Question 148 MCQ · 4.0 marks

Source diagram or notation
6406533052533.
0
6406533052534.
1
6406533052535.
2
6406533052536.
3

A published solution is not available for this question yet.

Report a correction for Q148

Question 149 MCQ · 4.0 marks

Source diagram or notation
6406533052558.
0
6406533052559.
1
6406533052560.
2
6406533052561.
3

A published solution is not available for this question yet.

Report a correction for Q149

Question 150 MCQ · 4.0 marks

Source diagram or notation
6406533052567.
1
6406533052568.
2
6406533052569.
3
6406533052570.
0

A published solution is not available for this question yet.

Report a correction for Q150

Question 151 MCQ · 5.0 marks

Source diagram or notation
6406533052485.
2 2 4 6
6406533052486.
2 4 4 6
6406533052487.
2 4 6 6
6406533052488.
4 4 6 6

A published solution is not available for this question yet.

Report a correction for Q151

Question 152 MCQ · 5.0 marks

Source diagram or notation
6406533052489.
a = 1, b = 2 a = 2, b = 1
6406533052490.
a = 2, b = 1 a = 1, b = 2
6406533052491.
a = 1, b = 1 a = 2, b = 2
6406533052492.
a = 2, b = 2 a = 1, b = 1

A published solution is not available for this question yet.

Report a correction for Q152

Question 153 MCQ · 5.0 marks

Source diagram or notation
6406533052509.
5 6 6 7 7
6406533052510.
5 6 5 6 5
6406533052511.
5 6 5 6 6
6406533052512.
5 6 6 7 6

A published solution is not available for this question yet.

Report a correction for Q153

Question 154 MCQ · 5.0 marks

Source diagram or notation
6406533052521.
1 2 3
6406533052522.
2 3 4
6406533052523.
3 4 5
6406533052524.
1 3 5

A published solution is not available for this question yet.

Report a correction for Q154

Question 155 MCQ · 5.0 marks

Source diagram or notation
6406533052546.
Value of a: 0 Value of a: 1
6406533052547.
Value of a: 1 Value of a: 2
6406533052548.
Value of a: some_garbage_value Value of a: some_garbage_value
6406533052549.
Value of a: 1 Value of a: 1

A published solution is not available for this question yet.

Report a correction for Q155

Question 156 MCQ · 5.0 marks

Source diagram or notation
6406533052554.
expecto
6406533052555.
patronum
6406533052556.
-patronu
6406533052557.
expecto-

A published solution is not available for this question yet.

Report a correction for Q156

Question 157 MSQ · 4.0 marks

Select the correct statements from the below that dynamically allocate memory to hold a maximum of 2 characters. Assume size of int is 4 bytes, size of char is 1 byte and size of pointer is 8 bytes.
6406533052538.
char* a = (char*)malloc(16);
6406533052539.
char* a = (char*)malloc(2);
6406533052540.
char* a = (char*)malloc(2*sizeof(char));
6406533052541.
char* a = (char*)malloc(2*sizeof(char*));

A published solution is not available for this question yet.

Report a correction for Q157

Question 158 MSQ · 5.0 marks

Source diagram or notation
6406533052529.
(*p1_ptr).hp = 95;
6406533052530.
p1->hp -= 5;
6406533052531.
p1_ptr->hp -= 5;
6406533052532.
p1_ptr.hp = 95;

A published solution is not available for this question yet.

Report a correction for Q158

Question 159 NAT · 4.0 marks

Source diagram or notation

A published solution is not available for this question yet.

Report a correction for Q159

Question 160 NAT · 5.0 marks

Source diagram or notation

A published solution is not available for this question yet.

Report a correction for Q160

Question 162 MCQ · 0.0 marks

**Note:** For numerical answer type questions, enter your answer correct upto two decimal places without rounding up or off unless stated otherwise.
6406533052573.
Instructions has been mentioned above.
6406533052574.
This Instructions is just for a reference & not for an evaluation.

A published solution is not available for this question yet.

Report a correction for Q162