Professional Documents
Culture Documents
2. what is the function used for reading input to the program from standard input?
a) print() b)printf() c) scan() d) scanf()
13.
14. In functions, parameters can be passed through ________calling_____ and called function
techniques.
D. 2 bytes
23) Which of the following is the correct way to declare a multidimensional array in Java?
A. int arr[[]];
B. int[] arr;
C. int[][]arr;
D. int[[]] arr;
24) Size of the array need not be specified, when
A. It is a formal parameter
B. It is a declaratrion
C. Initialization is a part of definition
D. All of these
25) When does the ArrayIndexOutOfBoundsException occur?
A. Run-time
B. Not an error
C. Compile-time
D. Not an exception at all
26) Array is an example of _______ type memory allocation.
A. Compile time
B. Run time
C. Both A and B
D. None of the above
27) Which of the following function is more appropriate for reading in a multi-word string?
A. scanf()
B. printf()
C. gets()
D. puts()
28) What are the advantages of arrays?
A. Easier to store elements of same data type
B. Index of first element of an array is 1
C. Elements in an array cannot be sorted
D. Objects of mixed data types can be store
29) What are the disadvantages of arrays?
A. Index value of an array can be negative
B. Elements are sequentially accessed
C. Data structure like queue or stack cannot be implemented
D. There are chances of wastage of memory space if elements inserted in an array are lesser
than the allocated size
30) Elements in an array are accessed _____________
A. randomly
B. sequentially
C. exponentially
D. logarithmically
35) The keyword used to transfer control from a function back to the calling function a)
switch
b) goto
c) go back
d) return
a) Formal arguments
b) Actual Arguments
c) Definite Arguments
d) Ideal Arguments