Professional Documents
Culture Documents
1. [A]
2. [C]
4. What happens when you try to access an Array variable outside its Size.? [C]
Page No.: 1
Subject Name & Code : Introduction to Programming ( 23ES104A ) Exam Name : Q2
5. [A]
6. Can we change the starting index of an array from 0 to 1 in any way.? [C]
A) yes by help of pointers B) yes by help of call by values C) no D) None of the mentioned
A) You need not create so many separate B) Using a single Array variable, you can C) Code maintainability is easy for D) all of the mentioned
variables and get confused while using. access all elements of the array easily. programmers and maintainers.
8. [A]
Page No.: 2
Subject Name & Code : Introduction to Programming ( 23ES104A ) Exam Name : Q2
9. [C]
A) 0 B) 2 C) garbage value D) 1
A) To access 3rd Row 2nd element use B) its an array of arrays C) its llike a matrix with rows and D) all of the mentioned
ary[2][1] as the index starts from 0 row or columns
column
11. If an integer array pointer is incremented, how many bytes will be skipped to reach next element location.? [D]
A) 1 B) 2 C) 4 D) either b or c
12. [C]
Page No.: 3
Subject Name & Code : Introduction to Programming ( 23ES104A ) Exam Name : Q2
A) 10 10 10 B) 20 20 10 C) 10 20 30 D) 30 20 10
13. What is the function used to allocate memory to an array at run time with Zero initial value to each.? [A]
14. What is the function used to allocate memory to an array at run time without initializing array elements.? [D]
15. What will happen if in a C program you assign a value to an array element whose subscript exceeds the size of array? [A]
A) The program may crash if some B) The array size would appropriately C) The element will be set to 0. D) The compiler would report an error.
important data gets overwritten. grow.
17. [B]
A) str1 is Quiz, str2 is Geeks B) str1 is Geeks, str2 is Quiz C) str1 is Geeks, str2 is Geeks D) str1 is Quiz, str2 is Quiz
Page No.: 4
Subject Name & Code : Introduction to Programming ( 23ES104A ) Exam Name : Q2
18. [C]
19. [A]
A) geeksquiz B) run time error C) compile time error D) geeksquiz followed by garbage
characters
20. [B]
A) Compile time error B) nothing will be printed C) Run time Error D) gnirt
Page No.: 5
Subject Name & Code : Introduction to Programming ( 23ES104A ) Exam Name : Q2
21. [C]
22. [A]
23. If the two strings are identical, then strcmp() function returns [C]
A) 1 B) 2 C) 0 D) 3
24. The library function used to find the last occurrence of a character in a string is [C]
25. Which of the following function is more appropriate for reading in a multi-word string? [B]
Page No.: 6
Subject Name & Code : Introduction to Programming ( 23ES104A ) Exam Name : Q2
char ary[]="Hello..!";
A) Character array, ary is a string. B) ary has no Null character at the end C) string size is undefined D) string should not contain special
characters
27. What is the Format specifier used to print a String or Character array in C Printf or Scanf function.? [C]
A) %c B) %d C) %s D) %w
29. An integer array of dimension 10 is declared in a C program. The memory location of the first byte of the array is 1000. What will be the [B]
location of the 9th element of the array? (Assume integer takes 4 bytes of memory and the element stored at 1000 is i
A) 1028 B) 1032 C) 1024 D) 1036
30. What actually gets passed when you pass an array as an argument to a function? [C]
A) value of elements in array B) first element of the array C) base address of the array D) address of the last element of the
array
A) can store any datatype B) only stores element of the similar C) acquires the datatype with the D) it is not possible to have an array of
datatype to first element highest precision in it void datatype
32. [C]
Page No.: 7
Subject Name & Code : Introduction to Programming ( 23ES104A ) Exam Name : Q2
A) 10 B) 20 C) 40 D) 60
33. __________ bytes are required to encode 2000 bits of data. [B]
A) 8 B) 2 C) 4 D) 6
35. To make larger program into the smaller ones these are called ------------------- [B]
A) Functions can return any type B) Functions C) values D) None of the mentioned
38. Which of the following have their changes in their declaration related to constness of parameter? [A]
39. How many elements does a floating point number is composed of? [B]
A) 3 B) 4 C) 1 D) 2
Page No.: 8
Subject Name & Code : Introduction to Programming ( 23ES104A ) Exam Name : Q2
40. [A]
41. [A]
Page No.: 9
Subject Name & Code : Introduction to Programming ( 23ES104A ) Exam Name : Q2
A) 40 B) 32 C) 30 D) 20
42. [A]
43. [D]
A) 2 B) 5 C) 4 D) 3
A) Helps to avoid repeated Program across B) Enhance the logical clarity of the C) Helps to avoid repeating set of D) all of the mentioned
Programs Program statements many times
Page No.: 10
Subject Name & Code : Introduction to Programming ( 23ES104A ) Exam Name : Q2
A) Must contain atleast one Function B) Should not contain any function C) Needs input Data D) None of the mentioned
A) (b) (c ) and (d) are correct B) Function is a block of statement that C) function is a fundamental modular D) function has a name and its Reuse
performs specific task unit which performs specific task
A) int funct(int x) { return x= x+1;} B) int funct(int x) C) float funct(x) { wait x= x+1;} D) None of the mentioned
49. [D]
Page No.: 11
Subject Name & Code : Introduction to Programming ( 23ES104A ) Exam Name : Q2
50. [A]
A) Number of elements between two pointer B) Number of elements between two C) Number of elements between two D) run time error
are: 5. Number of bytes between two pointer are: 20. Number of bytes pointer are: 5. Number of bytes
pointers are: 20 between two pointers are: 20 between two pointers are: 5
51. [C]
A) Pointers allow different functions to B) To pass large structures so that C) Pointers enable complex “linked" D) all of the mentioned
share and modify their local variables. complete copy of the structure can be data structures like linked lists and
avoided. binary trees.
A) Representation of void pointer B) Error C) Representation of NULL pointer D) None of the mentioned
Page No.: 12
Subject Name & Code : Introduction to Programming ( 23ES104A ) Exam Name : Q2
A) A variable that stores address of other B) A variable that stores address of an C) A keyword used to create variables D) all of the mentioned
variable instruction
55. The operator used to get value at address stored in a pointer variable is [C]
A) % B) && C) * D) #
56. How can you write a[i][j][k][l] in equivalent pointer expression? [D]
58. [A]
59. Which of the following does not initialize ptr to null (assuming variable declaration of a as int a=0)? [A]
A) int *ptr = &a; B) int *ptr = &a – &a; C) int *ptr = a – a; D) None of the mentioned
60. Pointer is special kind of variable which is used to stored __________ of the variable. [B]
61. In order to fetch the address of the variable we write preceding _________ sign before variable name. [C]
Page No.: 13
Subject Name & Code : Introduction to Programming ( 23ES104A ) Exam Name : Q2
64. [A]
66. [B]
67. Which of the following are correct syntaxes to send an array as a parameter to function: [B]
Page No.: 14
Subject Name & Code : Introduction to Programming ( 23ES104A ) Exam Name : Q2
68. [C]
69. How many number of pointer (*) does C have against a pointer variable declaration? [B]
A) 16 B) 32 C) 256 D) No limit
A) 10 B) 0 C) 1 D) 100
72. [A]
Page No.: 15
Subject Name & Code : Introduction to Programming ( 23ES104A ) Exam Name : Q2
A) Alphabets, Numbers, %,$ B) Alphabets, Numbers, dollar$ C) Alphabets, Numbers, Underscore ( _ D) Alphabets, Numbers, Special
) Symbols
74. [A]
75. [B]
A) * = ADDRESS OF operator, & = B) * = VALUE AT operator, & = ADDRESS C) * = ADDRESS OF operator, & = D) * = VALUE AT operator, & = VALUE
ADDRESS OF operator OF operator VALUE AT operator AT operator
Page No.: 16
Subject Name & Code : Introduction to Programming ( 23ES104A ) Exam Name : Q2
76. [D]
77. Arguments passed to a function in C language are called ___ arguments. [A]
79. What is the default return value of a C function if not specified explicitly.? [C]
A) -1 B) 0 C) 1 D) 2
Page No.: 17
Subject Name & Code : Introduction to Programming ( 23ES104A ) Exam Name : Q2
80. [B]
81. [A]
A) 3 3 1, B) 3 3 1, C) 3 1 1, D) 3 3 1,
3 1 3, 3 1 3, 3 1 3, 3 3 3,
331 311 331 331
Page No.: 18
Subject Name & Code : Introduction to Programming ( 23ES104A ) Exam Name : Q2
82. [C]
A) 1 1 3 B) 1 3 3 C) 3 1 3 D) 3 3 3
83. [B]
Page No.: 19
Subject Name & Code : Introduction to Programming ( 23ES104A ) Exam Name : Q2
84. [C]
A) 20 0 0 B) 40 30 20 C) 20 30 40 D) 40 20 30
85. [A]
Page No.: 20
Subject Name & Code : Introduction to Programming ( 23ES104A ) Exam Name : Q2
86. [C]
88. [B]
90. what are the operations that we cannot perform in pointers concept? [C]
A) Allocation of memory B) Deallocation of memory C) (A) and (B) D) None of the mentioned
A) Returned by a function B) Passed to a function C) Changed to a function D) Can be assigned an integer value
A) A is structure and B is pointer B) A and B are structures C) a is a pointer to a structure and b is D) None of the mentioned
a structure
Page No.: 21
Subject Name & Code : Introduction to Programming ( 23ES104A ) Exam Name : Q2
93. [D]
A) if(myPtr) *myPtr = NULL; B) *myPtr = NULL; C) if(!myPtr) *myPtr = NULL; D) all of the mentioned
else *myPtr = NULL; else *myPtr = NULL;
94. [C]
95. The operators > and < are meaningful when used with pointers, if [A]
A) the pointers point to elements of the B) the pointers point to structure of similar C) the pointers point to data of similar D) None of the mentioned
same array data type type
96. [B]
97. Which of the following operators can be applied to pointer variable(s)? [A]
Page No.: 22
Subject Name & Code : Introduction to Programming ( 23ES104A ) Exam Name : Q2
98. [C]
100. Let x be an array. Which of the following cannot be present in the left hand side of an assignment statement? [D]
101. [A]
102. Let x be an array. Which of the following operations are illegal? [A]
103. If func is a function needing three arguments a1, a2, a3 then func can be invoked by [D]
A) func(a1, a2, a3) ; B) (*func)(a1, a2, a3); C) *func(a1, a2, a3); D) (a) & (b)
Page No.: 23
Subject Name & Code : Introduction to Programming ( 23ES104A ) Exam Name : Q2
104. [B]
A) p is a one dimensional array of size 5, of B) p is a pointer to a 5 element integer C) the same as int *p[5]; D) all of the mentioned
pointers to integers array
105. [A]
106. [C]
A) ptr = malloc(m*n); strcpy(p, u); B) ptr = malloc (m*n); memset (p, 0, m*n); C) memset(0, m*n); D) malloc (m*n, 0);
108. If p is a pointer to an integer and t is a pointer to a character then sizeof (p) will be [C]
A) greater than that of sizeof (t) B) lesser than that of sizeof (t) C) same as that of sizeof ( t ) D) None of the mentioned
109. Which of the following comments about arrays and pointers is/are not true? [D]
A) Both are exactly same B) Array is a constant pointer C) Pointer is an one-dimensional and D) all of the mentioned
dynamic array
Page No.: 24
Subject Name & Code : Introduction to Programming ( 23ES104A ) Exam Name : Q2
111. The size of both stack and heap remains the same during run time. [B]
112. Which of the following header files must necessarily be included to use dynamic memory allocation functions? [A]
116. On freeing a dynamic memory, if the pointer value is not modified, then the pointer points to? [C]
A) Null B) Other dynamically allocated memory C) The same deallocated memory D) It points back to location it was
location initialized with
117. calloc initialises memory with all bits set to zero. [A]
118. Which header file should be included to use functions like malloc() and calloc()? [B]
119. What function should be used to free the memory allocated by calloc() ? [B]
120. [A]
A) malloc() and memalloc() B) alloc() and memalloc() C) malloc() and calloc() D) memalloc() and faralloc()
122. According to ANSI specifications which is the correct way of declaring main when it receives command-line arguments? [A]
A) int main(int argc, char *argv[]) B) int main(argc, argv) C) int main() D) None of the mentioned
int argc; char *argv; {
int argc; char *argv;
}
123. What do the 'c' and 'v' in argv stands for? [D]
A) 'c' means argument control 'v' means B) 'c' means argument count 'v' means C) 'c' means argument configuration 'v' D) 'c' means argument count 'v' means
argument vector argument vertex means argument visibility argument vector
Page No.: 26
Subject Name & Code : Introduction to Programming ( 23ES104A ) Exam Name : Q2
124. [B]
A) 4 B) 2 C) 8 D) Garbage value
125. [C]
Page No.: 27
Subject Name & Code : Introduction to Programming ( 23ES104A ) Exam Name : Q2
126. [A]
127. [C]
128. [D]
129. [C]
130. Which of the following is the correct syntax to send an array as a parameter to function? [C]
Page No.: 29
Subject Name & Code : Introduction to Programming ( 23ES104A ) Exam Name : Q2
A) should keep in mind B) should be follow rules C) should be declared D) should be declared and initlized
A) ptr is a pointer to the integer ,p is not B) p is a pointer to the integer ,ptr is not C) p is a pointer to the integer ,p is not D) Ptr is not a pointer to the integer ,Ptr
is pointer to integer
A) is synthetically correct B) is semantically correct C) is synthetically and symantically D) None of the mentioned
correct
A) the pointer points to the elements of the B) The pointer points to the data of same C) the pointer points to the structure of D) None of the mentioned
same array type the same type
A) P is apointer to a 5 element of the B) P is a array to a 5 element of the float C) P is apointer to a 5 element of the D) None of the mentioned
integer array array ireal array
A) we can change the value pointed by ptr B) we cannot change the value pointed by C) we can replace the value pointed by D) None of the mentioned
ptr ptr
138. Which of the following are correctly formed #define statements? [B]
A) #define INCH PER FEET 12 B) #define SQR(X) (X*X) C) #define SQR OF(X) (X*X) D) None of the mentioned
139. which of the following is the correct way for declaring the float pointer? [A]
140. what is the best data type of a pointer variable by which the memory would be allocated to it? [C]
Page No.: 30
Subject Name & Code : Introduction to Programming ( 23ES104A ) Exam Name : Q2
141. [B]
142. [C]
In which header file is the NULL macro defined?
A) stdio.h B) stddef.h C) stdio.h and stddef.h D) stdio.
143. [D]
How many bytes are occupied by near, far and huge pointers (DOS)?
A) near=2 far=4 huge=8 B) near=2 far=4 huge=10 C) near=2 far=8 huge=4 D) near=2 far=4 huge=4
144. [C]
If a variable is a pointer to a structure, then which of the following operator is used to access data members of the structure through the
pointer variable?
A) / B) * C) -> D) !
145. What would be the equivalent pointer expression for referring the array element a[i][j][k][l] [D]
146. [A]
The operator used to get value at address stored in a pointer variable is
A) * B) & C) && D) !
Page No.: 31
Subject Name & Code : Introduction to Programming ( 23ES104A ) Exam Name : Q2
147. [D]
A) Error R value is Required B) Error : Declaration Syntax C) Error: Value Required D) Error:Lvalue Required
148. A user defined data type, which is used to assign names to integral constants is called ____________ [D]
149. [B]
A) 1 B) 2 C) 0 D) Error
Page No.: 32
Subject Name & Code : Introduction to Programming ( 23ES104A ) Exam Name : Q2
150. [B]
A) No error B) Error in the statement: a,b,c; C) Error in the statement: enum hello D) Error in the statement:
m; printf(“%d”,m);
A) Two enum symbols cannot have the B) Only integer constants are allowed in C) It is not possible to change the value D) Enum variables are automatically
same value enums of enum symbols assigned values if no value is
specified
152. Which of the following are themselves a collection of different data types? [B]
154. Which operator connects the structure name to its member name? [C]
Page No.: 33
Subject Name & Code : Introduction to Programming ( 23ES104A ) Exam Name : Q2
156. [A]
157. [B]
Page No.: 34
Subject Name & Code : Introduction to Programming ( 23ES104A ) Exam Name : Q2
158. [C]
159. [D]
160. Which of the following keywords is used to define an alternate name for an already existing data type? [C]
Page No.: 35