Home / Study library / Programming in C / End Term · Jan 2024 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
Q70 Q71 Q72 Q73 Q74 Q75 Q76 Q77 Q78 Q79 Q80 Q81 Q82 Q83 Q84 Q85 Q86 Q87 Q88 Q89 Q90 Q91 Q92 Q93 Q94
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. 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?
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 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 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 6406532757056. End Term Exam
A published solution is not available for this question yet.
Report a correction for Q79
Question 80 MCQ · 4.0 marks 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 A published solution is not available for this question yet.
Report a correction for Q81
Question 82 MCQ · 4.0 marks A published solution is not available for this question yet.
Report a correction for Q82
Question 83 MCQ · 5.0 marks
What will be the output of the above program?
A published solution is not available for this question yet.
Report a correction for Q83
Question 84 MCQ · 5.0 marks 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 A published solution is not available for this question yet.
Report a correction for Q85
Question 86 MCQ · 5.0 marks A published solution is not available for this question yet.
Report a correction for Q86
Question 87 MCQ · 5.0 marks 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 A published solution is not available for this question yet.
Report a correction for Q88
Question 89 MSQ · 3.0 marks 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 6406532757080. 6406532757081. 6406532757082. 6406532757083. A published solution is not available for this question yet.
Report a correction for Q91
Question 92 NAT · 4.0 marks A published solution is not available for this question yet.
Report a correction for Q92
Question 93 NAT · 4.0 marks A published solution is not available for this question yet.
Report a correction for Q93
Question 94 NAT · 5.0 marks A published solution is not available for this question yet.
Report a correction for Q94