Thursday, April 30, 2009

3rd mid 13-05-09 online BITS

1. The recurrence relation that arises in relation with the complexity of binary search is
a. T(n)=T(n/2)+k, where k is constant
b. T(n)=2T(n/2)+k, where k is constant
c. T(n)=T(n/2)+log(n)
d. T(n)=T(n/2)+n
2. The running time T(n), where `n' is the input size of a recursive algorithm is given as followsT(n)=c+T(n-1),if n>1
d, if n≤ 1
The order of this algorithm is
a. n2
b. n
c. n3
d. nn
3. The concept of order(Big O) is important because
a. it can be used to decide the best algorithm that solves a given problem
b. It determines the minimum size of a problem that can be solved in a given system, in a given amount of time
c. It is the lower bound of the growth rate of the algorithm
d. It is the average bound of the growth rate of the algorithm
4. The concept of order(Big O) is important because
a. it can not be used to decide the best algorithm that solves a given problem
b. It determines the maximum size of a problem that can be solved in a given system, in a given amount of time
c. It is the lower bound of the growth rate of the algorithm
d. It is the average bound of the growth rate of the algorithm
5. The time complexity of an algorithm T(n), where n is the input size is given byT(n)=T(n-1)+/n, if n>1
=1 otherwise
The order of the algorithm is
a. log n
b. n
c. n2
d. nn
6. The running time of an algorithm is given byT(n)=T(n-1)+T(n-2)-T(n-3), if n>3
= n otherwise
The order of this algorithm is
a. n
b. log n
c. nn
d. n2
7. If n=4,then the value of O(log n) is
a. 1
b. 2
c. 4
d. 8
8. If n=4,then the value of O( n2) is
a. 4
b. 16
c. 64
d. 512
9. The average time complexity of insertion sort is
a. O(n2)
b. O(n)
c. O(1)
d. O(log n)
10. The running time of an algorithm is given byT(n)=T(n-1)+T(n-2)-T(n-3), if n>3
= n otherwise
What should be the relation between T(1),T(2) and T(3) so that its order is constant.
a. T(1)=T(2)=T(3)
b. T(1)+T(3)=2T(2)
c. T(1)-T(3)=T(2)
d. T(1)+T(2)=T(3)
11. The order of the algorithm that finds a given Boolean function of `n' variables , produces a is
a. constant
b. linear
c. non-linear
d. exponential
12. If n=16, then the value of O(n log n) is
a. 16
b. 32
c. 64
d. 128
13. How many memory management functions are there in C
a. 4
b. 3
c. 2
d. 1
14. Which of the following is not a C memory allocation function
a. alloc( )
b. calloc( )
c. free
d. malloc()
15. If n= 8, then the value of O(1) is
a. 1
b. 2
c. 4
d. 8
16. If n=4, then the value of O(n3) is
a. 4
b. 16
c. 64
d. 512
17. If n=2, then the value of O(n) is
a. 2
b. 3
c. 4
d. 5
18. All memory management functions are found in
a. stdlib.c
b. stdio.h
c. conio.h
d. math.h
19. The function that returns memory to the heap is
a. alloc( )
b. free( )
c. malloc( )
d. realloc( )
20. Which of the following statement about the releasing memory allocation is false?
a. It is an error to dereference a pointer to allocated memory after the memory has been released
b. It is an error to free memory with a pointer to other than the first element of an allocated array
c. Memory should be freed as soon as it is no longer needed
d. To ensure that it is released , allocated memory should be freed before the program
21. The syntax of free() function
a. void free(void* free)
b. int free(void* ptr)
c. float free(void* ptr)
d. void free(ptr)
22. Which of the memory function allocates a block of memory
a. malloc ( )
b. calloc( )
c. release( )
d. free( )
23. Return type of a calloc( ) function is
a. int
b. float
c. char
d. void
24. Return type of a realloc( ) function is
a. int
b. float
c. char
d. void
25. Which of the following memory management function used to release memory
a. malloc( )
b. calloc( )
c. release( )
d. free( )
26. Which of the following is considered auxiliary storage?
a. disk
b. random access memeory(RAM)
c. read only memory(ROM)
d. EEPROM
27. Which of the following is not a standard file stream?
a. stdin
b. stderr
c. stdfile
d. stdout
28. The C library that contains the prototype statements for the file operations is
a. file.h
b. proto.h
c. stdio.h
d. stdlib.h
29. In C, local variable are stored in
a. stack
b. heap
c. permanent storage
d. hard disk
30. The linked list field(s) are
a. data
b. pointer
c. pointer to next node
d. data and pointer to next node
31. The linked list structure is defined as
a. struct node
{
int item;
struct node *next;
};
b. node
{
int item;
struct node *next;
};
c. struct node
{
int item;
node *node;
};
d. node
{
Int item;
node next;
};
32. Dynamic memory area is
a. heap
b. stack
c. permanent storage
d. Hard disk
33. The contents of the storage space allocated dynamically, can be accessed through _ _ _ _ _ _ _
a. structure variables
b. pointers
c. unions
d. arrays
34. Each item in the list contains a �link� to structure containing the _ _ _ _ _ _ _ item
a. previous
b. next
c. present
d. last
35. In C, program instructions are stored in
a. stack
b. heap
c. permanent storage
d. Hard disk
36. In C, Global variables are stored in
a. permanent storage
b. stack
c. heap
d. Hard disk
37. In C, static variables are stored in
a. heap
b. permanent storage
c. Hard disk
d. Stack
38. A list refers to a set of items organized _ _ _ _ _
a. sequentially
b. exponentially
c. non-sequentially
d. factorially
39. Each structure of a linked list consists _ _ _ _ _ _ _ no. of fields
a. 2
b. 3
c. 4
d. 1
40. Linked lists are not suitable for data structures of which one of the following problem?
a. insertion sort
b. Binary search
c. radix sort
d. polynomial manipulation problem
41. An item that is read as input can be either pushed to a stack and latter popped and printed, or printed directly. Which of the following will be the output if the input is the sequence of items-1,2,3,4,5?
a. 3,4,5,1,2
b. 3,4,5,2,1
c. 1,5,2,3,4
d. 5,4,3,1,2
42. No.of pointers to be manipulated in a linked list to delete an item in the middle _ _ _ _ _ _ _
a. Zero
b. One
c. Two
d. Three
43. No.of pointers to be manipulated in a linked list to delete first item
a. Zero
b. One
c. Two
d. Three
44. Stack is useful for _ _ _ _ _ _ _
a. radix sort
b. breadth first search
c. recursion
d. quick sort
45. The end of the list is marked as
a. node.next=0
b. (node.last = 0)
c. node.next= &node;
d. node.previous=0;
46. No.of pointers to be manipulated in a linked list to insert an item in the middle _ _ _ _ _ _ _ _
a. Two
b. Three
c. One
d. Zero
47. No. of pointers to be manipulated in a linked list to delete last item
a. Zero
b. One
c. Two
d. Three
48. Single linked list uses _ _ _ _ _ _ no. of pointers
a. Zero
b. one
c. Two
d. Three
49. LIFO is
a. stack
b. queue
c. linked list
d. tree
50. A stack is has the entries a,b,c,(with a on top). Stack B is empty. An entry popped out of stack A can be printed immediately or pushed to stack B.An entry popped out of stack B can only be printed. In this arrangement, which of the following permutations a,b,c is not possible?
a. b a c
b. b c a
c. c a b
d. a b c
51. Which of the following programming languages features require a stack-base allocation
a. pointer
b. Block-structure
c. recursion
d. dynamic scoping
52. Push down stack or push down list is
a. stack
b. queue
c. linked list
d. dequeue
53. Stack is useful for
a. radix sort
b. breadth first search
c. recursion
d. Heap sort
54. Stacks can not be used to
a. evaluate an arithmetic expression in postfix form
b. implement recursion
c. convert a given arithmetic expression in infix form to is equivalent postfix form
d. allocates resources (like CPU) by the operating system
55. Stack is useful for implementing
a. radix sort
b. breadth first search
c. selection sort
d. depth first search
56. Which of the following is useful in implementing quick sort?
a. stack
b. set
c. list
d. queue
57. Which of the following is essential for converting an infix expression to postfix form efficiently?
a. An operator stack
b. An operand stack
c. An operator stack and an operand stack
d. A parse tree
58. A stack is most suitable to evaluate _ _ _ _ _ expression
a. postfix
b. prefix
c. infix
d. post & infix
59. Linear linked data structure is
a. tree
b. graph
c. stack
d. binary tree
60. A queue of characters currently contained a,b,c,d. What would be the contents of queue after the following operationDELETE, ADD W, ADD X, DELETE, ADD Y
a. A,B,C,W,Y
b. C,D,W,X,Y
c. W,Y,X,C,D
d. A,B,C,D,W
61. Which of the following data structure is suitable for priority queue?
a. Doubly linked list
b. Circular queues
c. Binary search
d. Heaps
62. For storing the sorted data on which often insert and deletion operations are performed, the following data structure is better
a. Array
b. queue
c. linked-list
d. doubly linked-list
63. A circular queue of size N will sign queue full when the number of elements in the queue is
a. N-1
b. N
c. N+1
d. N-2
64. The postfix equivalent of the prefix * + a b - c d is
a. ab + cd - *
b. ab cd + - *
c. ab + cd * -
d. ab + - cd *
65. The postfix expression for the infix expressionA + B* (C+D) / F + D*E is:
a. AB + CD + F / D + E*
b. ABCD + * F / + DE*
c. A*B + CD / F*DE ++
d. A+ BCD / F* DE ++
66. A telephone system which places cells to a particular number on hold can best represented by
a. queue
b. stack
c. linked-list
d. variable
67. The performance of an algorithm is specified by the following notation that represents the worst case
a. O-notation
b. Omega notation
c. Theta notation
d. alpha-notation
68. If front=rear ,then the queue is
a. full
b. empty
c. unknown value
d. 1/2 full
69. Reverse polish expression is
a. Infix
b. postfix
c. prefix
d. post & prefix
70. A list of integers is read in, one at a time, and a binary search tree is constructed. Next the tree is traversed and the integers are printed. Which traversed would result in a printout which duplicates the original order of the list of integers?
a. pre-order
b. post-order
c. in-order
d. in-fix order
71. The postfix expression for the infix expression A + B* (C+D) / F + D*E is
a. AB + CD + * F/D + E *
b. ABCD + *F / + DE* +
c. A*B + CD / F*DE ++
d. A + *BCD / F*DE ++
72. The equivalent of (a+b↑c↑d)*(e+f/d) in the post fix notation is
a. ab+c↑d↑e &fd/
b. abcd↑+↑efd/+*
c. abcdefd/+*↑↑+
d. abcd↑↑+efd/+*
73. The infix form of the postfix expression ABC-/D*E+ is
a. A/B-C*D+E
b. A-B/C*D+E
c. (A-B)/C*D+E
d. A/(B-C)*D+E
74. The postfix expression for the infix expression A/B*C+D*E is
a. AB/C*DE*+
b. ABC/*DE+*
c. ABCD/*E+*
d. ABC*/D*E+
75. The prefix expression for the infix expressionA/B*C+D*E is
a. AB/C*DE*+
b. +*/ABC*DE
c. +*AB/C*DE
d. /+ABCDE
76. Suffix expression is
a. Infix
b. postfix
c. prefix
d. post & prefix
77. polish expression is
a. infix
b. postfix
c. prefix
d. post & prefix
78. To convert an Infix expression into postfix we require
a. stack
b. queue
c. linked list
d. dequeue
79. A stack is most suitable to evaluate _ _ _ _ _ _ _ expression
a. postfix
b. prefix
c. infix
d. post & infix
80. The circular linked list have
a. no beginning
b. no ending
c. beginning but no ending
d. no beginning and no ending
81. To insert a node at the beginning of the doubly linked list _ _ _ _ _ _ _ _ no. of pointers to be manipulated
a. 1
b. 2
c. 3
d. 4
82. Doubly linked list uses _ _ _ _ _ _ _ _ no.of pointers
a. Zero
b. One
c. Two
d. Three
83. To insert a node at the beginning of the single linked list _ _ _ _ _ _ _ no. of pointers to be manipulated
a. 1
b. 2
c. 3
d. 0
84. To insert a node at middle of the single linked list _ _ _ _ _ _ _ _ _ _ no. of pointers to be manipulated
a. 1
b. 2
c. 3
d. 4
85. To insert a node at the end of the doubly linked list _ _ _ _ _ _ _ no. of pointers to be manipulated
a. 1
b. 2
c. 3
d. 4
86. To insert a node at the end of the single linked list _ _ _ _ _ _ _ _ no. of pointers to be manipulated
a. 1
b. 2
c. 3
d. 4
87. To delete the first node in single linked list _ _ _ _ _ _ _ _ no. of pointers to be manipulated
a. 1
b. 2
c. 3
d. 4
88. To delete the last node in single linked list _ _ _ _ _ _ _ no. of pointers to be manipulated
a. 1
b. 2
c. 3
d. 0
89. To delete the middle node in single linked list _ _ _ _ _ _ _ no. of pointers to be manipulated
a. 1
b. 2
c. 3
d. 4
90. To delete an item in the middle of a circular doubly linked list, _ _ _ _ _ _ _ _ no.of points to be manipulated
a. 2
b. 4
c. 6
d. 8
91. If storage class is missing in the array definition, by default it will be taken to be
a. automatic
b. external
c. static
d. either automatic or external depending on the place of occurrence
92. To delete the last node in doubly linked list _ _ _ _ _ _ _ _ no. of pointers to be manipulated
a. 1
b. 2
c. 3
d. 4
93. To delete the middle node in doubly linked list _ _ _ _ _ _ _ _ _ no. of pointers to be manipulated
a. 1
b. 2
c. 3
d. 4
94. To insert an item in a circular doubly linked list, _ _ _ _ _ _ _ no.of points to be manipulated
a. 1
b. 2
c. 3
d. 4
95. Which of the following features of C is meant to provide reliable access to special memory
a. static _ const
b. pragma
c. volatile
d. immutable
96. To insert a node at middle of the doubly linked list _ _ _ _ _ _ _ no. of pointers to be manipulated
a. 1
b. 2
c. 3
d. 4
97. To delete the first node in doubly linked list _ _ _ _ _ _ _ _ no. of pointers to be manipulated
a. 1
b. 2
c. 3
d. 4
98. To insert an item in a circular single linked list _ _ _ _ _ _ _ _ _ no.of points to be manipulated
a. 2
b. 3
c. 4
d. 1
99. To delete an item in a circular doubly linked list, _ _ _ _ _ _ _ _ no.of points to be manipulated
a. 1
b. 2
c. 3
d. 4
100. A sorting technique is called stable if:
a. it takes O ( n log n) time
b. It maintains the relative order of occurrence of non-distinct elements
c. It uses divide and conquer paradigm
d. The maximum number of nodes in a binary tree of height h is (2 -1)(The height of the root is reckoned as 0)
101. The maximum number of comparisons needed to sort 7 items using radix sort is (assume each item is a 4 digit decimal number)
a. 280
b. 40
c. 47
d. 38
102. If each node in a tree has a value greater than every value in its left sub tree and has value less than every value in its right sub tree, the binary tree is known as
a. Complete binary tree
b. Full binary tree
c. Binary search tree
d. Threaded binary tree
103. A binary tree in which if all its levels except possibly the last, have the maximum number of nodes and all the nodes at the last level appear as far as possible, is known as
a. full binary tree
b. 2-tree
c. threaded tree
d. Complete binary tree
104. You are asked 15 randomly generated numbers. You should prefer
a. bubble sort
b. quick sort
c. merge sort
d. heap sort
105. Which data structure is needed to convert infix notation to post fix notation
a. B-tee
b. Queue
c. Tree
d. Stack
106. The time required to search an element in a binary search tree having n elements is
a. O(1)
b. O(log2 n)
c. O(n)
d. O(n log2 n)
107. A binary tree T has n leaf nodes. The number of nodes of degree 2 in T is
a. log2 n
b. n-1
c. n
d. 2n
108. A tree, for which at every node the height of its left sub tree and right sub tree differ at most by one is a/an
a. Binary search tree
b. AVL tree
c. Complete binary tree
d. Threaded binary tree
109. Which of the following sorting algorithms does not have a worst case running time complexity of O(n2)?
a. Insertion sort
b. Merge sort
c. Quick sort
d. Bubble sort
110. Which of the following is not a correct statement
a. internal sorting is used if the number of items to be sorted is very large
b. External sorting is used if the number of items to be sorted is very large
c. External sorting needs auxiliary storage
d. Internal sorting needs auxiliary storage
111. There are 4 different algorithms A1,A2,A3,A4 to solve a given problem with the order log(n),log(log(n)),nlog(n),n/log(n) respectively. Which is the best algorithm?
a. A1
b. A2
c. A3
d. A4
112. Which of the following algorithms exhibits the unusual behavior that, minimum numbers of comparisons are needed if the list to be sorted is in the reverse order and maximum numbers of comparisons are needed if they are already in sorted order?
a. Heap tree
b. Radix sort
c. Binary insertion sort
d. Selection sort
113. You want to check whether a given set of items is sorted. Which of the following sorting methods will be the most efficient if it is already in sorted order?
a. bubble sort
b. selection sort
c. insertion sort
d. merge sort
114. The way a card game player arranges his cards as he picks them up one by one , is an example of
a. bubble sort
b. selection sort
c. insertion sort
d. merge sort
115. Which of the following sorting algorithm has the worst time complexity of nlog(n)?
a. Heap sort
b. Quick sort
c. Insertion sort
d. Selection sort
116. Which of the following sorting methods sorts a given set of items that is already in sorted order or in reverse sorted order with equal speed?
a. Heap sort
b. Quick sort
c. Insertion sort
d. Selection sort
117. Which of the following sorting methods will be the best if number of swapping done, is the only measure of efficiency?
a. bubble sort
b. insertion sort
c. selection sort
d. heap sort
118. As part of the maintenance work, you are entrusted with the work of rearranging the library books in a shelf in proper order, at the end of each day. The ideal choice will be
a. bubble sort
b. insertion sort
c. selection sort
d. heap sort
119. Sorting is not useful for
a. report generation
b. minimizing the storage needed
c. making searching easier and efficient
d. responding to queries easily
120. A machine took 200 sec to sort 200 names, using bubble sort. In 800 sec. it can approximately sort _ _ _ _ _ _ _ _ _ names
a. 400
b. 800
c. 750
d. 1600
121. A machine needs a minimum of 100 sec. to sort 1000 names by quick sort. The minimum time needed to sort 100 names will be approximately
a. 50.2 sec
b. 6.7 sec
c. 72.7 sec.
d. 11.2 sec.
122. A sorting method with _ _ _ _ _ _ _ _ is the most efficient method
a. O(log n)
b. O(n)
c. O(1)
d. O(n2)
123. Which of the following statement is false?
a. Optimal binary search construction can be performed efficiently using dynamic programming
b. Breadth-first search cannot be used to find connected components of a graph
c. Given the prefix and postfix walks of a binary tree, the binary cannot be uniquely reconstructed
d. Depth-first search can be used to find the connected components of a graph
124. The average successful search time for sequential search on 'n' items is
a. n/2
b. (n-1)/2
c. (n+1)/2
d. log(n)+1
125. A hash function f defined as f(key)=key mod 7, with linear probing, is used to insert the keys 37,38,72,48,98,1,56, into a table indexed from 0 to 6. What will be the location of key 11?
a. 3
b. 4
c. 5
d. 6
126. The order of the binary search algorithm is
a. n
b. n2
c. nlog(n)
d. log(n)
127. Linked lists are not suitable for implementing
a. insertion sort
b. binary search
c. radix sort
d. polynomial manipulation
128. Stack is useful for
a. radix sort
b. breadth first search
c. heap sort
d. depth first search
129. Which of the following algorithm design technique is used in the quick sort algorithm?
a. Dynamic programming
b. Backtracking
c. Divide and conquer
d. Greedy method
130. The average successful search time taken by binary search on a sorted order array of 10 items is
a. 2.6
b. 2.7
c. 2.8
d. 2.9
131. A 3-ary tree in which every internal node has exactly 3 children. The number of leaf nodes in such a tree with 6 internal nodes will be
a. 10
b. 17
c. 23
d. 13
132. Which of the following traversal techniques lists the nodes of a binary search tree in ascending order?
a. post-order
b. In-order
c. Pre-order
d. No-order
133. A general linear list is a list in which operations, such as retrievals, insertions, changes, and deletions can be done _ _ _ _ _ _ _ _ _
a. any where in the list
b. only at the beginning
c. only at the end
d. only at the middle
134. A(n) _ _ _ _ _ _ _ is a collection of elements and relationship Among them.
a. abstract data type
b. array
c. data structure
d. standard type
135. Data that consists of a single, non decomposable entity are known as _ _ _ _ _ _
a. atomic data
b. array
c. data structure
d. standard type
136. A binary tree has n leaf nodes. The number of nodes of degree 2 in this tree is
a. logn
b. n-1
c. n
d. 2n
137. A full binary tree with n leaf nodes contains
a. n nodes
b. log2 n nodes
c. 2n-1 nodes
d. 2n nodes
138. The number of binary trees with 3 nodes which when traversed in post-order gives the sequence A,B,C is
a. 3
b. 9
c. 7
d. 5
139. Which of the following need not be a binary tree?
a. Search tree
b. Heap
c. AVL-tree
d. B-tree
140. A binary tree in which every non-leaf node has non-empty left and right subtrees is called a strictly binary tree.Such a tree with 10 leaves
a. cannot be more than 19 nodes
b. has exactly 19 nodes
c. has exactly 17 nodes
d. can not have more than 17 nodes
141. Find the odd man out
a. binary tree
b. Avl tree
c. graph
d. queue
142. The depth of a complete binary tree with n nodes(log is to the base two)
a. log(n+1)-1
b. log(n)
c. log(n+1)+1
d. log(n)+1
143. The following is an example of a non-linear data structure
a. stack
b. queue
c. tree
d. linear list
144. If a graph is represented as a linked list, _ _ _ _ _ _ _ _ _ no.of list nodes are required
a. 1
b. 2
c. 3
d. 4
145. The number of possible binary trees with 4 nodes is
a. 12
b. 14
c. 13
d. 15
146. The number of possible binary trees with 3 nodes is
a. 12
b. 13
c. 5
d. 15
147. The number of possible ordered trees with 3 nodes A,B,C is
a. 16
b. 12
c. 6
d. 10
148. A tree is a _ _ _ _ _ data structure
a. non-recursive
b. recursive
c. linear
d. non-linear
149. A node that does not have any sub-tree is called a _ _ _ _ _ _ _
a. terminal node
b. root node
c. left node
d. right node
150. The number of edges in a regular graph of degree d and n vertices is
a. maximum of n, d
b. n+d
c. nd
d. nd/2
151. Which of the following algorithms solves the all pair shortest path problem?
a. Diskstra's algorithm
b. Floyd algorithm
c. Prim's algorithm
d. Warshall's algorithm
152. The minimum number of colors required to color a graph having n (n>3) vertices and 2 edges is
a. 4
b. 3
c. 2
d. 1
153. The maximum degree of any vertex in a simple graph with n vertices is
a. n
b. n-1
c. n+1
d. 2n-1
154. A graph G with n nodes is bipartite if it contains
a. n edges
b. a cycle of odd length
c. no cycle of odd length
d. n2 edges
155. A graph can be represented as an _ _ _ _ _ _
a. Linked list
b. Structure
c. Union
d. Queue
156. A graph can be represented as an _ _ _ _ _ _
a. Array
b. Structure
c. Union
d. Queue
157. The minimum number of edges in a connected cyclic on n vertices is
a. n-1
b. n
c. n+1
d. n+2
158. Which of he following is useful in traversing a given graph by breadth first search?
a. Stack
b. Set
c. List
d. Queue
159. Sparse matrices have
a. many zero entries
b. many non-zero entries
c. higher dimensions
d. lower dimensions
160. The maximum no.of edges in an undirected graph with out loops with n vertices is
a. n
b. n*(n-1)
c. n*(n-1)/2
d. n-1
161. Which of the following abstract data types can be used to represent a many to many relationship
a. tree
b. graph
c. queue
d. stack
162. In a directed graph without self loops with n verices , the maximum no.of edges is
a. n
b. n*(n-1)
c. n*(n-1)/2
d. n-1
163. An n vertex undirected graph with exactly n*(n-1)/2 edges is said to be
a. Complete graph
b. Un complete graph
c. Directed graph
d. Un directed graph
164. To create a node dynamically in a singly linked list _ _ function in C is used
a. malloc()
b. calloc()
c. alloc()
d. dealloc()
165. In an undirected graph, the sum of degrees of all the nodes
a. must be even
b. is thrice the number of edges
c. must be odd
d. need not be even
166. In an undirected graph, the sum of degrees of all the nodes
a. is thrice the number of edges
b. is twice the number of edges
c. must be odd
d. need not be even
167. _ _ _ function is used to in C to dynamically allocate space for more than one object
a. malloc()
b. calloc()
c. alloc()
d. dealloc()
168. _ _ _ function is used to in C to dynamically allocate space for one object
a. malloc()
b. calloc()
c. alloc()
d. dealloc()
169. If n=2, then the value of O(n log n) is
a. 2
b. 4
c. 8
d. 16
170. Calloc(m,n); is equivalent to
a. malloc(m*n,0);
b. memset(0,m*n);
c. ptr=malloc(m*n);memset(p,0,m*n)
d. ptr=malloc(m*n);strcpy(p,0)
171. If the sequence of operations push(1),push(2) ,pop, push(1),push(2),pop, pop, pop, push(2),pop, are performed on a stack, the sequence of popped out values are
a. 2,2,1,1,2
b. 2,2,1,2,2
c. 2,1,2,2,1
d. 2,1,2,2,2
172. return type of a realloc( ) function is
a. int
b. float
c. char
d. void
173. To delete an element from a queue we use the _ _ _ _ _ operation
a. pop
b. push
c. enqueue
d. dequeue
174. To add an element to a queue we use the _ _ _ _ _ operation
a. pop
b. push
c. enqueue
d. dequeue
175. Which of the memory function allocates a contiguous memory
a. malloc( )
b. calloc( )
c. release( )
d. free( )
176. Return type of a malloc( ) function is
a. int
b. float
c. char
d. void
177. A queue is a _ _ _ _ _ _ structure
a. first in-last out
b. lasting-first-out
c. first in-first out
d. last in-last out
178. A queue is a list in which insertion can be done _ _ _ _
a. any where in the list
b. only at the beginning
c. only at the end
d. only at the middle
179. A _ _ _ _ _ _ is a first in - last out(FIFO) data structure in which insertions are restricted to one end, called the rear, and deletions are restricted to another end ,called the front
a. Stack
b. queue
c. tree
d. binary tree
180. The pointer(s) in a queue points to
a. start of the queue
b. end of the queue
c. middle of the queue
d. both start and end of the queue
181. The disadvantage of the queue is
a. when the item is deleted, the space for that item is not claimed
b. when the item is deleted, the space for that item is claimed
c. a non destructive
d. increases the memory space
182. A queue is a list in which deletion can be done _ _ _ _
a. any where in the list
b. only at the beginning
c. only at the end
d. only at the middle
183. Read() operation in queue is
a. non-destructive
b. additive
c. push()
d. destructive
184. In which of the data structure, space for the item is not claimed ,when an item is deleted
a. queue
b. circular queue
c. stack
d. linked list
185. As the items from a queue get deleted, the space for item is not reclaimed in queue. This problem is solved by
a. circular queue
b. stack
c. linked list
d. doubly linked list
186. Which of the following operation is used to add an item in a queue
a. write()
b. read()
c. pop()
d. push()
187. _ _ _ _ no.of pointers are required to implement read and write operations in a queue
a. two
b. three
c. four
d. five
188. FIFO is
a. stack
b. queue
c. linked list
d. tree
189. Which of the following operation is used to an item in a queue
a. write()
b. read()
c. pop()
d. push()
190. The number of swapping needed to sort the numbers 8,22,7,9,31,19,5,13 in an ascending order, using bubble sort is
a. 11
b. 12
c. 13
d. 14
191. Given two sorted list of size 'm' and 'n'. The number of comparisons needed by the merge sort algorithm will be
a. m x n
b. maximum of m,n
c. minimum of m,n
d. m+n-1
192. For merging two sorted lists of sizes m and n into a sorted list of size m+n, requires _ _ _ _ _ _ _ _ no.of comparisons
a. O(m)
b. O(n)
c. O(m+n)
d. O(log(m)+log(n))
193. The principle of locality justifies the use of
a. interrupts
b. DMA
c. polling
d. cache memory
194. The concatenation of two lists is to be performed in O(1) time. Which of the following implementations of a list could be used?
a. Singly linked list
b. Doubly linked list
c. Circularly doubly linked list
d. Array implementation of list
195. The initial condition of a queue is
a. front=rear=-1
b. front=rear
c. front=rear=n
d. front=rear=1
196. A sorting technique that guarantees , that records with the same primary key occurs in the same order in the sorted list as in the original unsorted list is said to be
a. stable
b. consistent
c. external
d. linear
197. The average number of comparisons performed by the merge sort algorithm , in merging two sorted lists of length 2 is
a. 8/3
b. 8/5
c. 11/7
d. 1/16
198. Merge sort uses
a. divide and conquer strategy
b. backtracking approach
c. heuristic approach
d. greedy approach
199. Queue can be used to implement
a. radix sort
b. quick sort
recursion
c. depth first search

Wednesday, April 29, 2009

3rd online bits

second mid online bits

C C C C B A B D C A
}
A. 65 66 67
B. A B C D
C. 65 66 67 68
D. A B C
15. "a+" is used to
A. read a file
B. read and append a file
C. append a file
D. Write into a file
16. The general formate of fscanf( ) is
A. fscanf(fp,controlstring,list);
B. fscanf(fp,list);
C. fprintf(fp, controlstring, list);
D. fscanf(fp,controlstring);
17. #include
main( )
{ char s[ ]={'a', 'b','c',' \n ', 'c', '\0'};
char *p, *str, *str1;
p=&s[3];str=p;str1=s;
printf("%d",++*p+ ++*str1-32);
}
A. b
B. a
C. Compiler error
D. M
18. The body of union should end with
A. colon( :)
B. Period ( . )
C. Semicolon( ; )
D. comma( , )
19. main()
{ int a=5,b,*c; c=&a;b=*c;
printf("\n value of a=%d & b=%d", a,b)}
A. a=5,d=5
B. a=6,d=6
C. a=4, b=4
D. a=3,b=3
20. Functions do not require
A. Formal parameters
B. Local parameters
C. Global parameters
D. Universal parameters



D A A C A B D D B A
A A D A B A D C A A



1. struct{ int I;
float j;} s; size(s) will be
A. 6 bytes
B. 0 bytes
C. 2 bytes
D. 4 bytes
2. Which of the following is used with Printf( ) function for printing the Address of a variable
A. %d
B. %u
C. %f
D. %c
3. Which of the following allows a program to read from or write to files at Command prompt
A. in out direction
B. in direction
C. out direction
D. redirection
4. An array is represented in Memory by using a
A.Sequential map
B. Parallel map
C. element map
D. circular map
5. which of the following mode opens a binary file in write mode
A. getw( )
B. putw( )
C. wb( write )
D. feof( )
6. Struct a { int I;
float j;
}; Which of the following syntax is correct to declare a struct variable
A. Struct a t;
B. union struct a;
C. struct union a;
D. union a t;
7. Which of the following operator is used the pointer to access he members of a structure
A. &&
B. ( .)
C. *
D. ->
8. main( )
{char s[6]="HELLO"
printf("%d", s[6]);
}
output is
A. 45
B. compiler error
C. 34
D. 0
9. main( )
{ char *str1="abcd";
char str2[ ]="abcd";
printf("%d%d%d", sizeof(str1),sizeof(str2),sizeof("abcd"));}
A. 2 5 5
B. 5 5 2
C. Compiler error
D. 5 2 5
10. If struct member is array, then an individual array element can be accessed by writting a variable
A. Stucture(member)
B. member(datatype)
C. member(structure)
D. member(expression)
11. The general form of array declaration is
A. Type array name[type]
B. Type variable name[size]
C. Type data name[type]
D. Type data name[size]
12. The variable can be accessed by a Pointer using the Operators
A. & and -
B. & and *
C. // and ++
D. & and +
13. Which is not true among the following
A. Brazil( ) is a user defined function
B. Printf( ) is a Library function
C. A function can be called from another function
D. A function can be defined in another function
14. A block of memory is allocated using the function
A. falloc( )
B. dalloc( )
C. malloc( )
D. calloc( )
15. In which of the following header files the standard file pointers have been defined
A. stdconio.h
B. stdpointer.h
C. stdstream.h
D. stdio.h
16 Which of the following function places cursur at appropriate position on the screen
A. go to( )
B. goto xy( )
C. go ( )
D. goto screen( )
17. The function that is used to detect the end of file is
A. feof( )
B. fgetch( )
C. go ( )
D. goto screen( )
18. "a+" is used to
A. read a file
B. append a file
C. read and append a file
D. Write in to file
19. Which of the following is a costruct that allows memory to be shared by different types of data
A. union
B. struct
C. Bit field
D. type def
20. Which of the following sign is used to access the structure members
A. ->
B. &&
C. ( . )
D. *



A B D A C A D B A D
B B D C D D A C A C



1. In union all members use
A. no location
B. same location
C. different location
D. no stroage
2. The process of call a function using pointers to pass the address of varaibles is known as
A. call by argument
B. call by parameter
C. call by value
D. call by reference
3. #include
main( )
{ char s[ ]={'a','b','c','\n', 'c', '\0'};
char *p,*str, *str1;
p=&s[3]; str=p; str11=s;
printf("%d",++ *p+ ++*str1-32);}
A. a
B. b
C. M
D. Compiler error
4. The arguments of calling functions are called
A. parameter arguments
B. Function call
C. Actual arguments
D. Formal arguments
5. Which of the following data structure used to process multiple elements with the same data types when number of such elements are know
A. Graph
B. Array
C. Atack
D. Quene
6. Which is not true among the following
A. Pointers decrease the Execution speed
B. Pointers are more efficient the arrays
C. Pointers are more efficient in handling the data tables
D. Pointers reduces the length and complexity of a program
7. #include
main( )
{
struct xx
{
int x;
struct yy
{char s; struct xx *p;
};
struct yy *q;
};
}
A. Compiler Error
B. m xy
C. yy
D. xx
8. struct aaa{ struct aaa *prev;
int i;
struct aaa*next;};
main( )
{
struct aaa abc,defghi,jkl;
int x=100;
abc.i=0;abc.prev=&jkl;abc.next=&def;
def.i=1 ;def.prev=&abc;def.next=&ghi;
ghi.i=2 ;ghi.prev=&def ;ghi.next=&jkl;
jkl.i=3 ;jkl.prev=&ghi; jkkl.next=&abc;
x=abc.next->next prev->next-> i;
printf("%d",x);}
A.2
B. Compiler error
C. 3
D. 4
9. The type def Statement is used for
A. Declaring user defined data types
B. Declaring variant data types
C. for assigning values to vareiables
D. for type casting of variables
10. main( )
{ FILE *fp;
fp=fopen("test", "r");
}
A. A structure which contains a char pointer to first character in the file
B. The first character in the file
C. The name of the file
D. The last character in the file
11. Which of the following function is used for storing information in a disk file
A. fprintf( )
B. fscanf( )
C. printf( )
D. Scanf( )
12. Portion of memory to be shared by different types of data is
A. field
B. array
C. struct
D. union
13. The fscanf( ) statement reads data from
A. key board
B. file
C. scanner
D. program
14. The general format os fprintf( ) function is
A. fprintf(control string, list)
B. fprintf(fp,list)
C. fprintf(fp,"controlstring")
D. fprintf(fp,controlstring,list)
15 Which of the following function takes the otal number of data and size each data
A. free
B. realloc
C. malloc
D. calloc
16. main( )
{char s[6]="HELLO"
printf("%d",s[6]);
}
output is
A. 45
B. compiler error
C. 34
D. 0
17. main( )
{char *str1="abcd";
char str2[ ]="abcd";
printf("%d%d%d",sizeof(str1),sizeof(str2),sizeof("abcd"));}
A. 5 2 5
B. 5 5 2
C. compiler error
D. 2 5 5
18. main( )
{ int *j;
int i=10;
j=&i;}
printf("%d",*j);}
A. 5
B. 7
C. 10
D. 15
19. Which of the following is used to read a character from the keyboard rather than for a file
A. ch=fputc(std in)
B. ch=fget(std in)
C. ch= fput(std in)
D. ch= fgetc(std in)
20. The operators are called
A. Out direction
B. Redirection Operators
C. in direction
D. in out direction


B D C C B A A A A A
A C B D D B D C B B



1. An array is represented in Memorey by using a
A. Circular map
B. Sequential map
C. Parallel map
D. element map
2. In which of the following header files the standard file Pointers have been defined
A. std conio.h
B. std pointer.h
C. stdio.h
D. stdstream.h
3. Each field in a structure can be accessed and manipulated using
A. variables and members
B. variables and operands
C. operands and arguments
D. Expressions and operators
4. Which of the following function is used to remove the specified file from the disk
A. rewind( )
B. unlink( )
C. getw( )
D. fseek( )
5. #include
main( )
{
struct xx
{ int x=3; char name[ ]="hello";
};
struct xx *s=malloc(sizeof(strct xx));
printf("%d",s->x);
printf("%s"s->,name);
}
A. Compiler error
B. hello
C. xx
D. name
6. The function that is used to detect the end of file is
A. fgetch( )
B. fputs( )
C. ferror( )
D. feof( )
7. The general format of realloc function is
A. ptr=realloc(free)
B. ptr=realloc(ptr)
C. ptr=realloc(ptr,newsize)
D. ptr=realloc(size)
8. The internal Representation of bit field of bit field is
A. Human independent
B. Machine dependent
C. Machine Independent
D. Human dependent
9. Which of the following operations can be performed on the file "TEST.C" if it is successfully opened using the statment
FILE *fp;
fp=fopen("TEST.C","r+");
A. Writing
B. Reading
C. appending and ariting
D. Appending
10. Address x[I]= where I is of type int
A. Base address + ( I )
B. index address + (I+ scale factor of int)
C. Base address + (I + scale factor of int)
D. Index address + ( I )
11.How much Memory of the Compiler Reserves for each integer array element
A. 2 bytes
B. 8 bytes
C. 6 bytes
D. 4 bytes
12. The general form of array decleration is
A. Type array name[type]
B. Type variable name[ size]
C. Type data name[type]
D. Type data name[size]
13.Self referential structure means
A. Refers to any structure
B. Refers to the same structure
C. Refers to different structure
D. Refers to pointers
14. void main( )
{ int const * p=5;
printf("%d",++(*p));}
A. Compiler error
B. 10
C. 5
D. 15
15. #include
main( )
{ char s[ ]={ 'a','b','c','\n','c','\0'};
char *p, *str, *str1;
p=&s[3]; str=p;str1=s;
printf("%d",++*p+ ++*str1-32);}
A. b
B. M
C. a
D. compiler error
16. Which of the following is a string of charaters that make up a valid name for the operating system
A. extension name
B. period name
C. header name
D. file name
17. struct{ int I;
flaot j;} s; size(s) will be
A. 4bytes
B. 2bytes
C. 6bytes
D. 0bytes
18. main(int argc, char**argv)
{
printf("enter the character");
getcahr( );
sum(argv[1],arg[2]);
}
sum(num1,num2)
int num1,num2;
{
return num1+num2;
}
A. num1
B. num2
C. num1+num2
D. Compiler error
19. The process of calling a function using pointers to pass the address of variables is known as
A. call by parameter
B. call by refernece
C. call by value
D. call by argument
20. Which of the following operator is used to copy the contents of all structure elements of different fata types tp another variable of its type
A. =
B. *
C. &
D. ->

B C D B A D C B B C
A B B A B D C D B A


1. int b[5];
main( )
{ static int a[5];
int I;
for(I=0;I<4;I++)
printf("%d%d",b[I],a[I]);
}output is
A. 0000.5times
B. error
C. garbage values
D. 000.10times
2. The body of union should end with
A.colon( : )
B. semicolon( ; )
C. Period ( .)
D. comma ( ,)
3. If structure member is array, then an individual array element can be accessed by writting a variable
A. Structure(member)
B. member(Structure)
C.Member(expression)
D. member(datatype)
4.struct aaa{ struct aaa *prev;
int i;
struct aaa*next;};
main( )
{
struct aaa abc,defghi,jkl;
int x=100;
abc.i=0;abc.prev=&jkl;abc.next=&def;
def.i=1 ;def.prev=&abc;def.next=&ghi;
ghi.i=2 ;ghi.prev=&def ;ghi.next=&jkl;
jkl.i=3 ;jkl.prev=&ghi; jkkl.next=&abc;
x=abc.next->next prev->next-> i;
printf("%d",x);}'
A. 3
B. 2
C. 4
D. compiler error
5. The amount of storage required for holding the elements of array depends on
A. size
B. Memory
C. Type and size
D. Type
6. Which of the following function is used for storing information in a disk file
A. Scanf( )
B. fscanf( )
C. printf( )
D. fprintf( )
7. The indirection( * )operator is also called as
A. deference operator
B. Star operator
C. Inference operator
D. bit wise operator
8. Struct {int I; float J;) *s; if the address stores in S is 2000, what is the value of s+3?
A. 2009
B. 2000
C. 2006
D. 2012
9. func(a,b)
inta, b;
{ return(a=(a= = b));
}
main( )
{
int process( ), func( );
printf("The value of process is %d ! \n", process(func,3,6));
}process(pf,val1,val2)
int(*pf) ( );int val1,val2;
{
return((*pf)(val1,val2));
}
The value of process is
A. Compiler eror
B. 3!
C. 1!
D. 0!
10. The EOF is equivalent to
A. 2
B. 1
C. -1
D. 0
11.Which of the following operators are called redirection operators
A. <- - ->
B. 1
C. -1
D. 0
12. We can pass parameters to a program at command line using
A. Actual arguments
B. Command line arguments
C. Parameter aruments
D. Command parameter arguments
13. The general format of fprintf( ) function is
A. fprintf(fp,list)
B. fprintf(control string, list)
C. fprintf(fp,controlstring,list)
D. fprintf(fp,"controlstring")
14. Which is not true among the following
A. A function can be called from another function
B. Brazil( ) is a user defined function
C. A function can be defined in another function
D. Printf( ) is a Library function
15. The C library that contains the Prototype statement for the file operation is
A. proto.h
B. file.h
C. stdio.h
D. stdlib.h
16. #include
main( )
{
struct xx
{
int x;
struct yy
{ char s; struct xx *p;
};
struct yy *q;
};
}
A. Compiler Error
B. yy
C. xx
D. m xy
17. A type defined Structure starts with the keyword
A. Case
B. Void
C. Typedef
D. Struct
18. The general format of free function is
A. free(newsize)
B. free(size)
C. free(ptr)
D. free(ptr,size)
19. main( )
{int arr[ ]={'A','B','C','D'};
int I;
for(I=0;I<3;I++)
printf("%d",arr[I]);
}
A. 65 66 67 68
B. A B C D
C. A B C
D. 65 66 67
20. The arguments of calling functions are called
A. Formal arguments
B. Function call
C. Actual arguments
D. Parameter arguments


D B C B C D A A D C
B B C C B A C C D C


1. puts(argv[0])prints
A. argv
B. the number of command line arguments
C. the name of executable code file
D. the name of the source code file
2. Struct a{ int I;
float j;
} s; size of (s) will be
A. 8 bytes
B. 6bytes
C. 0 bytes
D. 2 bytes
3. enum colors { BLACK,BLUE,GREEN}
main( )
{
printf("%d..%d.. %d",BLACK,BLUE,GREEN);
return(1);}
A. 0,1
B. black
C. Compiler error
D. 0,1,2
4. The valid range of subscript in an array is
A. size
B. 1 to Size-1
C. 0 to size-1
D. 0 to Size
5. Portion of memory to be shared by different tpes of data is
A. union
B. struct
C. field
D. array
6. Which of the following function is used to set the record pointer at the beginning of the file
A. putc( )
B. getw( )
C. rewind( )
D. gets( )
7. Which of the following operator is used to open the contents of all structure elements of different data types to another structure variable of its type
A. ->
B. &
C. =
D. *
8. main( )
{ int *j;
{ int i=10; j=&i;
}printf("%d",*j);
}
A. 5
B. 10
C. 20
D. 15
9. The process of calling a function using pointers tp pass the addresses of variables is known as
A. call by value
B. call by parameter
C. call by reference
D. call by argument
10. Which of the following is used with printf( ) funxction for printing the address of a variable
A. %f
B. %c
C. %u
D. %d
11.Which of the following operations can be performed on the "TEST.C" if it is successfully opened using the statement
FILE *fp
fp=fopen("TEST.c","r+");
A. writing
B. Appending
C. Reading
D. appending and writing
12. Which is not true among the following
A. Pointers reduces the lenth and complexity of a program
B. Pointers are more efficient than arrays
C. Pointers are more efficient in handling the data tables
D. Pointers decrese the Execution speed
13. A character array always ends with
A. Full stop
B. NULL character
C. &
D. ?
14. The general format of free function is
A. free(ptr)
B. free(ptr,size)
C. free(size)
D. free(new size)
15. Which of the following function is used for storing information in a disk file
A. printf( )
B. scanf( )
C. fprintf( )
D. fscanf( )
16. Which of the following operators are called redirection operators
A. ?, *
B. < , >
C. ->,<-
D. <- - ->
17. A function gets called when the function name is followed by
A. comma( ,)
B. Period ( .)
C. Colon( :)
D. Semi colon(;)
18. The internal Representation of bit field is
A. Human independent
B. Machine dependent
C. Human dependent
D. Machine independent
19.Which of the following function are used to detect I/o errors in the files
A. feof& ferror
B. f i/0 & fof
C. eof & error
D. fofe & f i/o
20. The pointer accessing method is _________ than Array indexing
A. same efficient
B. slower
C. faster
D. less efficient



C B D C A C C B C C
C D B A C B D B A C




1.main( )
{int *j;
{ int i=10; j=&i;}
}
A. 7
B. 10
C. 5
D. compiler error
2. The general format of realloc function is
A. ptr=realloc(size)
B. ptr=realloc(ptr)
C. ptr= realloc(ptr,newsize)
D. ptr= realloc(free)
3. Which of the following standard file pointer is used for standard auxiliary device
A. std prn
B. std aux
C. std io
D. std conio
4. Array elements can be accessed using
A. pointer
B. Tree
C. stack
D. queue
5. Address x[ I ]=where I is of type int
A. Base address + ( I )
B. Base address + (I+ scale factor of int)
C. Index address + ( I + scale factor of int)
D. Index address + ( I )
6. The general formate of sending a copying of entire structure to the function is
A. Structure name(function variable name)
B. Function name (structure variable name)
C. structure name(function )
D. function name(structure)
7. The operators are called
A. in direction
B. in out direction
C. out direction
D. redirection operators
8. The body of the stucture should end with
A. semicolon( ; )
B. comma( , )
C. colon (:)
D. period(.)
9. Which is a self contained block of code that performs a particular task
A.Stack
B. Array
C. Pointer
D. Function
10. Example of a self-referential Structure
A. Elements in a stack
B. Nodes in a Tree
C. Elements in a quene
D. Nodes in a Linked list
11. Which of the following unary operator is used to specify the size of the structure
A. Length( )
B. unary( )
C. sizeof( )
D. struct( )
12. In a program a function can be called
A. one time
B. two times
C. three times
D. any no.of times
13. In arrays of structures the members are referred using
A. *
B. ->
C. &&
D. ( . )
14. Which of the following sets the file postion marker to the starting of the file
A. fseek(ptr)
B. fseek(ptr,seek_cur);
C.fseek(ptr,0,SEEK_SET);
D. fseek(ptr,0,SEEK_CUR);
15. main( )
{int a=5,b,*c;c=&a;b=*c;
printf("\n value of a=%d & b=%d",a,b,)}
A. a=3,b=3
B. a=4,b=4
C. a=6,d=6
D. a=5,d=5
16.The general format of fprintf( ) function is
A. fprintf(fp,list)
B. fprintf(control string,list)
C. fprintf(fp,controlstring,list)
D. fprintf(fp, "controlstring")
17. enum colors{BLACK,BLUE,GREEN}
main( )
{ printf("%d..%d..%d",BLACK,BLUE,GREEN);
return(1);}
A. 0,1,2
B. compiler error
C. 0,1
D. black
18 func(a,b)
int a,b;
{return(a=(a= =b));
}
main( )
{
int process( ),func( );
printf("The value of process is %d! \n", process(func,3,6));
} process(pf,val!,val2)
int (*pf) ( ); int val1,val2;
{
return((*pf)(val1,val2));
}
the value of process is
A. 3!
B. compiler error
C.0!
D. 1!
19. Which of the following function is used for storing information in a disk file
A. fprintf( )
B. fscanf( )
C. scanf( )
D. printf( )
20. The general format of feof function is
A. feof(fp,"controlstring");
B. feof("control string",list);
C. feof(fp,list);


D C B A B B D A D D
C D D C D C A C A D


1.Which of the following is a string of characters that make up a vanu name for operating system
A. header name
B. period name
C. file name
D. extension name
2. Structure elements can be accessed through a pointer to a structure using the operator
A. *
B. ->
C. ( , )
D. &
3. Pointer to pointer is also called as
A. Pointer function
B. Pointer structure
C. Pointer direction
D. pointer indirection
4. main( )
{ char *p; p="HELLO";
printf("%c \n ",*&*p);
}
A. HE
B. HELLO
C. HELL
D. H
5. Which of the following standard file pointer is used for atandard Auxiliary device
A. std conio
B. std aux
C. std prn
D. std io
6."r+" is used to open a file in
A. read and write mode
B. append mode
C. write mode
D. read mode
7. How much Memory the compiler Resrves for each integer array element
A. 4bytes
B. 6bytes
C. 2 bytes
D. 8 bytes
8. main( )
{ char *str1="abcd";
char str2[ ]="abcd";
printf("%d%d%d",sizeof(str1),sizeof(str2),sizeof("abcd"));}
A. 2 5 5
B. 5 5 2
C. compiler error
D. 5 2 5
9. The general format f fprintf( ) function is
A. fprintf(fp,"controlstring")
B. fprintf(fp, controlstring,list)
C.fprintf(fp,list)
D. fprintf(control string,list)
10. struct a {int I;
float j;
}s; sizeof(s) will be
A. 8 bytes
B. 6bytes
C. 2bytes
D. 0bytes
11.Which is not true among the following
A. Brazil( ) is a user defined function
B. A function can be defined in another function
C. Printf( ) is a library function
D. A function can be called from another function
12.Which of the following keyword is used to specify an identifier for an existing datatype
A. union
B. type def
C.struct
D. case
13.Function donot require
A. Global parameters
B. Local parameters
C. Actual parameters
D.formal parameters
14. The function that reads the next charecter from the standard input stream and return its value is
A.Getc
B.Fgetc
C.Readchar
D.Getchar
15.#include
main( )
{
struct xx
{ int x=3; char name[]="hello";};
struct xx *s; printf("%d",s->x);printf("%s",s->name);}
A. he
B. hello
C.compiler error
D.hell
16. When we pass address to a function, the parameters recieving the address should be
A. Pointers
B. Union
C.Functions
D. Structures
17.Which true among the following
A. argh
A. argf
C. argv
D. argc
18. Which is true among the following
A. Pointers increase the exection speed
B. Pointers are not more efficient in handling the data tables
C. Pointers are not efficient than arrays
D. Pointers increase the length and complexity of the program
19. The general format of calloc is
A. ptr=(cast type *)calloc(byte size)
B. ptr=calloc(cast type*)bytesize
C. ptr=(cast type*)
D. ptr=(cast type*)calloc(n,elementsize)
20. Atype defined structure starts with the keyword
A. Struct
B.Case
C. Typedef
D.struct



C B D D B A C A B B
B B D D C A A D D C

WWW.DEXTEROUS.110MB.COM

SET 9
1.Which is not true among the following
A. Brazil( ) is a user defined function
B. A function can be defined in another function
C. Printf( ) is a library function
D. A function can be called from another function
2.How much memory the compiler reserves for each integer array element
A. 6bytes
B.8bytes
C.4bytes
D2bytes
3.Which of the following function is used to close all the files and returns number of files closed
A. fclose(fp)
B. close( )
C.fcloseall( )
D. closeall( )
4.the EOF is equivalent to
A. 0
B. 2
C. -1
D. 1
5. main( )
{ static int a[ ]={ 10,20,30,40,50};
int j;for(j=0;j<5;j++)
{printf(%d,a[j]);
a++;
}
} output is
A. 10 20 30 40
B. 10 20 30
C. 10 20
D.compilier error
6. Which of the following is not true
A. pointers can be used for addressing the bit field directly
B. bit field provides exact amount of bits reserved for storage value
C. Unions can apper in arrays and structures
D. Unions are used to conserve memory
7. Which of the following is a string of characters that make up a valid name for the operating system
A. header name
B. period name
C. file name
D. extension name
8. If Structure member is array, then an individual array element can be accessed by writing a variable
A.structure( member)
B. member (expression)
C. member(structure)
D.member(datatype)
9. Which of the following sets the file position marker to the current position of the file
A. fseek(ptr,0,SEEK_CUR);
B. fseek(ptr,0,SEEK_SET);
C. fseek(ptr,0,seek_cur);
D. fseek(ptr)
10. #include
main()
{
struct xx
{
int x;
struct yy
{char s; struct xx*p;
};
}
A. m xy
B. xx
C. Compiler Error
D. yy
11. Which of the following standard file pointer is used for standard Auxilary device
A. std prn
B. std conio
C. std aux
D. std io
12. The first parameter in he command line is always
A. struct name
B. Pointer name
C. program name
D. function name
13. A character array always ends with
A. ?
B. Full stop
C. NULL character
D. &
14. main( )
{ int a=5,b,*c;c=&a;b=*c;
printf("\n value of a=%d & b=%d",a,b);}
A. a=6,d=6
B. a=4,b=4
C. a=5,d=5
D. a=3,b=3
15. Self referential Structure means
A. Refers to pointers
B. Refers to the same structure
C. Refers to the different structure
D. Refers to any structure
16. #include
main( )
{struct xx
{ int x=3;char name[ ]="hello";};
struct xx *s; printf("%d",s->name);}
A. Compiler error
B. he
C. hell
D. hello
17. main( )
{
char *p; p="%d \n";
p++;
p++;
printf(p-2,300);
}
A. 296
B. 300
C. 298
D. compiler error
18 main()
{ int arr[ ]={'A','B','C','D'}
A 65 66 67 68
B. A B C D
C. A B C
D. 65 66 67
19. The general format of realloc function is
A ptr=realloc(free)
B. ptr=realloc(size)
C. ptr=realloc(ptr,newsize)
D. ptr= realloc(ptr)
20. The type def Statement is used for
A. Declaring user defined data types
B. declaring variant variables
C. for assigning values to variables
D. for type casting of variables



B D C C D A C B A C
Gandhiji Institute Of Science & Technology Jaggiahpet-521175
Department of Computer Science(Online Bits)
INSTRUCTOR by Banoth Samya M.Tech



1. Struct a{
int I;
float j;
}; Which of the following syntax is correct to declare a structure variable
A. struct union a;
B. union struct a;
C. union a t;
D. Struct a t;
2. Which of the following are Parameters supplied to a program when te program is invoked
A. Command line argument
B. parameter argument
C. reference argument
D. Actual argumen
3. main()
{char s[6]="HELLO"
printf("%d",s[6]);
}
output is
A. compiler error
B. 0
C. 34
D. 45
4. Which of the following sign is used to access the structure members
A. &&
B. *
C. ( . )
D. ->
5. main()
{ int *j;
{ int i=10;j=&i;
}printf("%d",*j);
}
A. 10
B. 20
C. 15
D. 5
6. Which of the following operator is used by the pointer to access the member of a structure
A. ( . )
B. ->
C. *
D. &&
7. Structure elements can be accessed through a pointer to a sructure Using the operator
A. ( , )
B. &
C. *
D. ->
8. Which of the following mode opens a binary file in write mode
A. feof( )
B. putw( )
C. getw( )
D. wb (write)
9. Array elements can be accessed using
A. Tree
B. Pointer
C. stack
D. Queue
10. Which of the following is a set of records that can be accessed through the set of Library Functions
A. File
B. Algorithm
C. program
D. Data
11. The general format of realloc function is
A. ptr=realloc(ptr,newsize)
B. ptr=realloc(ptr)
C. ptr=realloc(size)
D. ptr=realloc(free)
12. struct{ int I;
float j; } s; size(s) will be
A. 6 bytes
B. 0 bytes
C. 2 bytes
D. 4 bytes
13. The EOF is Equivalent to
A. 1
B. 2
C. 0
D. -1
14. main( ) { int arr[ ]={'A', 'B', 'C', 'D'}
int I; for( I=0; I<3; I++)
printf("%d",arr[I]);