MauryaHub PYQ Practice

Programming in C · End Term · Jan 2024 · AN

Programming in C · End Term · Jan 2024 AN

← 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 / 25 published solutions

Question 70 MCQ · 3.0 marks

Which of the following statements about recursion in C programming is **not true**?
6406532757048.
A recursive function calls itself.
6406532757049.
Recursive functions must have a base case to prevent infinite calls.
6406532757050.Source diagram or notation
The base case is optional for a recursive function.
6406532757051.
Recursive functions are used to implement functions like factorial of a number.

A published solution is not available for this question yet.

Report a correction for Q70

Question 71 MCQ · 3.0 marks

Let a pointer variable ptr hold the address of another integer variable var. Which of the following statements will correctly print the value of var?
6406532757052.
printf("%d", ptr);
6406532757053.
printf("%d", *ptr);
6406532757054.
printf("%d", ptr*);
6406532757055.
printf("%d", &ptr);

A published solution is not available for this question yet.

Report a correction for Q71

Question 72 MCQ · 3.0 marks

Which of the following statements is **not true** about arrays in C?
6406532757064.
An array stores a collection of elements of the same data type.
6406532757065.
Array index always starts with 1.
6406532757066.
Elements of an array are stored in contiguous memory locations.
6406532757067.
Array name acts like a constant pointer that always points to the first element of the array.

A published solution is not available for this question yet.

Report a correction for Q72

Question 73 MCQ · 3.0 marks

Which of the following statements is **true** about structures in C?
6406532757076.
They can only contain variables of the same data type.
6406532757077.
They always occupy a fixed size in memory regardless of members.
6406532757078.
They allow grouping of variables under a single name, even with different data types.
6406532757079.
They cannot be passed as arguments to functions.

A published solution is not available for this question yet.

Report a correction for Q73

Question 74 MCQ · 3.0 marks

In C programming, which memory region is typically used for dynamic memory allocation?
6406532757093.
Heap memory
6406532757094.
Stack memory

A published solution is not available for this question yet.

Report a correction for Q74

Question 75 MCQ · 3.0 marks

Which function is used to write data to a file in C programming?
6406532757099.
fwrite()
6406532757100.
fput()
6406532757101.
write()
6406532757102.
put()

A published solution is not available for this question yet.

Report a correction for Q75

Question 76 MCQ · 3.0 marks

What does the #define directive do in C preprocessor?
6406532757108.
Declares a variable with the value to initialize it.
6406532757109.
Defines textual symbols which are replaced by their values before compilation.
6406532757110.
Defines a function which may have parameters
6406532757111.
Includes a header file.

A published solution is not available for this question yet.

Report a correction for Q76

Question 77 MCQ · 4.0 marks

Source diagram or notation
6406532757032.
Value of c: 200
6406532757033.
Value of c: 170
6406532757034.
Value of c: 0
6406532757035.
Value of c: 180

A published solution is not available for this question yet.

Report a correction for Q77

Question 78 MCQ · 4.0 marks

Source diagram or notation
6406532757044.
main → diff→ sum → diff→ printf
6406532757045.
main → printf → diff → diff → sum
6406532757046.
main → printf → sum → diff→ diff
6406532757047.
main → sum→ diff → diff→ printf

A published solution is not available for this question yet.

Report a correction for Q78

Question 79 MCQ · 4.0 marks

Source diagram or notation
6406532757056.
End Term Exam
6406532757057.
Term
6406532757058.
Term Exam
6406532757059.
erm Exam

A published solution is not available for this question yet.

Report a correction for Q79

Question 80 MCQ · 4.0 marks

Source diagram or notation
6406532757068.
Length: 11 Size: 11
6406532757069.
Length: 11 Size: 12
6406532757070.
Length: 12 Size: 11
6406532757071.
Length: 12 Size: 12

A published solution is not available for this question yet.

Report a correction for Q80

Question 81 MCQ · 4.0 marks

Source diagram or notation
6406532757084.
4
6406532757085.
5
6406532757086.
6
6406532757087.
2

A published solution is not available for this question yet.

Report a correction for Q81

Question 82 MCQ · 4.0 marks

Source diagram or notation
6406532757113.
1
6406532757114.
2
6406532757115.
3
6406532757116.
0

A published solution is not available for this question yet.

Report a correction for Q82

Question 83 MCQ · 5.0 marks

Source diagram or notation
What will be the output of the above program?
6406532757036.
7 5 3 3
6406532757037.
7 7 5 3
6406532757038.
7 5 5 3
6406532757039.
7 7 3 3

A published solution is not available for this question yet.

Report a correction for Q83

Question 84 MCQ · 5.0 marks

Source diagram or notation
6406532757040.
a = 1, b = 2 a = 2, b = 1
6406532757041.
a = 2, b = 1 a = 1, b = 2
6406532757042.
a = 1, b = 1 a = 2, b = 2
6406532757043.
a = 2, b = 2 a = 1, b = 1

A published solution is not available for this question yet.

Report a correction for Q84

Question 85 MCQ · 5.0 marks

Source diagram or notation
6406532757060.
1 2 1 3 3
6406532757061.
1 2 2 3 3
6406532757062.
1 2 2 3 2
6406532757063.
1 2 3 3 2

A published solution is not available for this question yet.

Report a correction for Q85

Question 86 MCQ · 5.0 marks

Source diagram or notation
6406532757072.
1 2 3
6406532757073.
2 3 4
6406532757074.
3 4 5
6406532757075.
1 3 5

A published solution is not available for this question yet.

Report a correction for Q86

Question 87 MCQ · 5.0 marks

Source diagram or notation
6406532757095.
Value of a: 0 Value of a: 1 Value of a: 2 Value of a: 3
6406532757096.
Value of a: 1 Value of a: 2 Value of a: 3 Value of a: 4
6406532757097.
The program will crash because the static variable “a” is not initialized.
6406532757098.
Value of a: some_garbage_value Value of a: some_garbage_value Value of a: some_garbage_value Value of a: some_garbage_value

A published solution is not available for this question yet.

Report a correction for Q87

Question 88 MCQ · 5.0 marks

Source diagram or notation
6406532757103.
epliru
6406532757104.
xelams
6406532757105.
expell
6406532757106.
iarmus

A published solution is not available for this question yet.

Report a correction for Q88

Question 89 MSQ · 3.0 marks

Source diagram or notation
6406532757028.
The initialization expression is executed only once before the loop starts.
6406532757029.
If the condition expression is evaluated false, then the loop terminates.
6406532757030.
The loop body is always executed at least once.
6406532757031.
The increment/decrement expression is executed after each iteration of the loop.

A published solution is not available for this question yet.

Report a correction for Q89

Question 90 MSQ · 4.0 marks

Select the correct statements from the below that dynamically allocate memory to hold 3 integer pointers. Assume size of int is 4 bytes, size of char is 1 byte and size of pointer is 8 bytes.
6406532757089.
int* a = malloc(24);
6406532757090.
int** a = malloc(24);
6406532757091.
int* a = malloc(3*sizeof(int));
6406532757092.
int** a = malloc(3*sizeof(int*));

A published solution is not available for this question yet.

Report a correction for Q90

Question 91 MSQ · 5.0 marks

Source diagram or notation
6406532757080.Source diagram or notation
6406532757081.Source diagram or notation
6406532757082.Source diagram or notation
6406532757083.Source diagram or notation

A published solution is not available for this question yet.

Report a correction for Q91

Question 92 NAT · 4.0 marks

Source diagram or notation

A published solution is not available for this question yet.

Report a correction for Q92

Question 93 NAT · 4.0 marks

Source diagram or notation

A published solution is not available for this question yet.

Report a correction for Q93

Question 94 NAT · 5.0 marks

Source diagram or notation

A published solution is not available for this question yet.

Report a correction for Q94