MauryaHub PYQ Practice

Programming in C · End Term · Sep 2024 · AN

Programming in C · End Term · Sep 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 106 MCQ · 3.0 marks

Which of the following data types will result in the least memory allocation?
6406533529676.
double
6406533529677.
char
6406533529678.
short
6406533529679.
float

A published solution is not available for this question yet.

Report a correction for Q106

Question 107 MCQ · 3.0 marks

What is the scope of a variable declared inside a function in C?
6406533529692.
Global
6406533529693.
Local to the function
6406533529694.
Accessible only in main()
6406533529695.
Accessible in all functions called by the parent function

A published solution is not available for this question yet.

Report a correction for Q107

Question 108 MCQ · 3.0 marks

Source diagram or notation
6406533529713.
In little-endian format, the least significant byte is stored at the highest memory address.
6406533529714.
In little-endian format, the most significant byte is stored at the lowest memory address.
6406533529715.
In big-endian format, the most significant byte is stored at the lowest memory address.
6406533529716.
In big-endian format, the least significant byte is stored at the lowest memory address.

A published solution is not available for this question yet.

Report a correction for Q108

Question 109 MCQ · 3.0 marks

What is the key distinction between stack and heap memory in C programming?
6406533529734.
Stack memory is used for storing global variables, while heap memory is used for storing local variables.
6406533529735.
Stack memory is automatically managed for function calls, while heap memory requires explicit allocation and deallocation.
6406533529736.
Stack memory can grow indefinitely, while heap memory has a fixed size defined at compile time.
6406533529737.
There is no difference; stack and heap memory serve the same purpose in C programming.

A published solution is not available for this question yet.

Report a correction for Q109

Question 110 MCQ · 4.0 marks

Source diagram or notation
6406533529684.
10
6406533529685.
20
6406533529686.
0
6406533529687.
Compilation error

A published solution is not available for this question yet.

Report a correction for Q110

Question 111 MCQ · 4.0 marks

Source diagram or notation
6406533529696.
5
6406533529697.
10
6406533529698.
15
6406533529699.
Compilation error

A published solution is not available for this question yet.

Report a correction for Q111

Question 112 MCQ · 4.0 marks

What will be the output of the following C program?
Source diagram or notation
6406533529709.
10 0
6406533529710.
10 5
6406533529711.
10 10
6406533529712.
10 Garbage Value

A published solution is not available for this question yet.

Report a correction for Q112

Question 113 MCQ · 4.0 marks

Source diagram or notation
6406533529717.
A
6406533529718.
B
6406533529719.
C
6406533529720.
D

A published solution is not available for this question yet.

Report a correction for Q113

Question 114 MCQ · 4.0 marks

Source diagram or notation
6406533529721.
10
6406533529722.
20
6406533529723.
30
6406533529724.
40

A published solution is not available for this question yet.

Report a correction for Q114

Question 115 MCQ · 4.0 marks

Source diagram or notation
6406533529729.Source diagram or notation
6406533529730.Source diagram or notation
6406533529731.Source diagram or notation
6406533529732.Source diagram or notation

A published solution is not available for this question yet.

Report a correction for Q115

Question 116 MCQ · 4.0 marks

Choose the correct statement for fscanf() and scanf().
6406533529743.
fscanf() always reads from standard input whereas scanf() specifies a stream from which to read
6406533529744.
fscanf() specifies a stream from which to read whereas scanf() reads only from standard input
6406533529745.
fscanf() and scanf() have no difference in their functionalities
6406533529746.
fscanf() and scanf() can read from any specified stream

A published solution is not available for this question yet.

Report a correction for Q116

Question 117 MCQ · 4.0 marks

Source diagram or notation
6406533529760.Source diagram or notation
6406533529761.Source diagram or notation
6406533529762.Source diagram or notation
6406533529763.Source diagram or notation

A published solution is not available for this question yet.

Report a correction for Q117

Question 118 MCQ · 5.0 marks

Source diagram or notation
6406533529680.
9
6406533529681.
6
6406533529682.
8
6406533529683.
7

A published solution is not available for this question yet.

Report a correction for Q118

Question 119 MCQ · 5.0 marks

Consider the following code to check whether the input number is Prime or not. Consider that input is a positive integer. However, it contains a logical error.
Source diagram or notation
6406533529688.
7
6406533529689.
12
6406533529690.
25
6406533529691.
27

A published solution is not available for this question yet.

Report a correction for Q119

Question 120 MCQ · 5.0 marks

Source diagram or notation
6406533529700.
Counts the number of odd numbers from 1 to n.
6406533529701.
Counts the number of even numbers from 1 to n.
6406533529702.
The sum of odd numbers from 1 to n.
6406533529703.
The sum of even numbers from 1 to n.

A published solution is not available for this question yet.

Report a correction for Q120

Question 121 MCQ · 5.0 marks

Source diagram or notation
6406533529739.Source diagram or notation
6406533529740.Source diagram or notation
6406533529741.Source diagram or notation
6406533529742.Source diagram or notation

A published solution is not available for this question yet.

Report a correction for Q121

Question 122 MCQ · 5.0 marks

Source diagram or notation
6406533529748.
6
6406533529749.
2
6406533529750.
14
6406533529751.
1

A published solution is not available for this question yet.

Report a correction for Q122

Question 123 MCQ · 5.0 marks

Source diagram or notation
6406533529756.
25
6406533529757.
11
6406533529758.
27
6406533529759.
36

A published solution is not available for this question yet.

Report a correction for Q123

Question 124 MSQ · 4.0 marks

Which of the following statement(s) is/are true regarding the “static” keyword in C?
6406533529752.
A static variable inside a function retains its value between function calls.
6406533529753.
A static global variable has file scope, meaning it is only accessible within the file where it is declared.
6406533529754.
Static variables must be initialized at compile-time.
6406533529755.
A static function can be called from other files of the same program.

A published solution is not available for this question yet.

Report a correction for Q124

Question 125 MSQ · 3.0 marks

Which of the following statements about pointers is/are true?
6406533529704.
A pointer can be incremented to point to the next memory location of its type.
6406533529705.
A pointer variable cannot be reassigned after initialization.
6406533529706.
Dereferencing a pointer gives the value stored at the memory address it holds.
6406533529707.
Dereferencing a pointer gives the memory address it holds.

A published solution is not available for this question yet.

Report a correction for Q125

Question 126 MSQ · 3.0 marks

Which of the following statement(s) is/are true about **unions** in C?
6406533529725.
Unions can contain members of different data types.
6406533529726.
The size of a union is the sum of the sizes of all its members.
6406533529727.
Unions can be nested within other unions or structures.
6406533529728.
The size of a union is dynamically allocated based on the size of its members.

A published solution is not available for this question yet.

Report a correction for Q126

Question 127 NAT · 4.0 marks

Source diagram or notation

A published solution is not available for this question yet.

Report a correction for Q127

Question 128 NAT · 4.0 marks

Consider the following code.
Source diagram or notation
What will be the output of the program?

A published solution is not available for this question yet.

Report a correction for Q128

Question 129 NAT · 4.0 marks

Source diagram or notation

A published solution is not available for this question yet.

Report a correction for Q129

Question 130 NAT · 4.0 marks

Source diagram or notation

A published solution is not available for this question yet.

Report a correction for Q130