TECHNICAL 02
1. Choose the correct statement
a. String constants can be concatenated at compile time
b. Constant expressions are evaluated at compile time
c. Size of array must be known at compile time
d. All
2. Pick the operator that associate from the left
a. +
b. ,
c. All
d.
3. Which of the following comments about the “++” operator are correct?
a. It cannot be applied to an expression
b. It associates from the right
c. It is a unary operator
d. All
4. Most suitable option for “C” literal is
a. a string
b. an alphabet
c. a character
d. a string constant
5. “C” is a
a. Low Level Language
b. Low level language with some high level features
c. High Level Language with some low level features
d. High Level Language
6. “C” was primarily developed as a
a. Data Processing Language
b. None
c. General Purpose Language
d. Systems Programing Language
7. The “const” feature can be applied to
a. an array argument
b. All
c. an identifier
d. an array
8. Length of the string “Correct” is
a. 7
b. 6
c. Implementation dependent
d. 8
9. Pick the operator that associate from the right
a. + =
b. =
c. All
d. ?:
10. Choose the correct statement
a. All
b. an identifier may end with an underscore
c. IF is a valid identifier
d. An identifier may start with an underscore
11. If class A inherits from class B, then B is called ______of A. A is called ______of B.
a. Super class, Sub class
b. Subclass, Super class
c. Abstract class, Base Class
d. Child class, Sub Class
12. In how many ways is polymorphism achived in C++?
A. 2
B. 3
C. 1
D. 4
13. Which of the following mode declaration is used in C++ to open a file for input?
A. ios :: app
B. in :: ios
C. ios :: in
D. ios :: file
14. Which of the following statements is correct?
A. Pointer to derived class cannot be created.
B. Derived class pointer cannot point to base class.
C. Base class pointer cannot point to derived class.
D. Pointer to base class cannot be created.
15. Which of the following concept of oops allows compiler to insert arguments in a function call if it is not specified?
A. Default arguments
B. Call by reference
C. Call by value
D. Call by pointer
16. How many types of polymorphisms are supported by C++?
A.3
B.2
C.1
D. 4
17. What happens when we try to compile the class definition in following code snippet?
classBirds{};
class Peacock : protected Birds {};
A.It will not compile because a class cannot be protectedly inherited from other class.
B.It will not compile because class body of Eagle is not defined.
C.It will not compile because class body of Birds is not defined.
D. It will compile successfully.
18. What does the class definitions in following code represent?
A.Kind of relationship
B.Inheritance
C.has a relationship
D:Both A and C
19. Which of the following function prototype is perfectly acceptable?
A.intFunction(intTmp=show());
B.float-Show(int,float)Function(Tmp);
C.float Function(intTmp=Show(int,float));
D.Both A and C.
20. Which of the following function declaration is/are incorrect?
A. intSum(int a = 0, int b, int c = 3);
B. intSum(int a = 5, int b);
C. intSum(int a, int b = 2, int c = 3);
D. All are correct.
E. Both A and B are incorrect.
21. The average search time of hashing with linear probing will be less if the
load factor?
a) Is far less than one b)Equals one
c) Is far greater than one d)None of above
22. The complexity of binary search algorithm is?
a) N b) nlogn c) logn d) n2
23. The postfix equivalent of the prefix * + ab – cd is?
a) ab + cd - * b) abcd + - *
c) ab + cd * - d) ab + - cd *
24. The linked list implementation of sparse matrices is superior to the generalized dope vector method because it is?
a)Conceptually easier b) Completely dynamic
c) Efficient in accessing an entry d) Efficient if the sparse matrix is a band matrix e) A and B
25. Which of the following algorithm solves the all pair shortest path problem?
a)Dijkstra’s algorithm b) Floy’s algorithm
c) Prim’s algorithm d) Warshall’s algorithm
26. The way a card game player arrange his cards as e picks them up one by one, is an example of?
a) Bubble sort b) Selection sort
c) Insertion sort d ) Merge sort
27. What is Data Structure?
a) Way to organize data
b) Accessing of data elements in specified manner
c) Organization of mathematical and logical concepts
d) All of Above
28. Which operation is not possible on Data Structure?
a) Traversing b) Insertion
b) c) Reading d) Deletion
29. The memory address of the first elements is called?
a) Floor Address b) Foundation Address
c) First Address d) Base Address
30. Two dimensional arrays are also called?
a) Matrix Array b) Table Array
b) Both a and b d) None of the Above
31. If an expression contains double, int, float, long, then whole expression will
promoted into which of these data types?
a) long b) int c) double d) float
32. What is the output of this program?
classTest
{
public static void main(String args[])
{
char c1 = 'D';
char c2 = 84;
c2++;
c1++;
System.out.println(c1 + " " + c2);
}
}
a) E U b) U E c) V E d) U F
33. What is the output of this program?
classTest
{
publicstaticvoidmain(String[] args)
{
doubled=2.8;
System.out.println ("2.8%1.2 ="+ d%1.2);
}
}
a) 0.4 b) Compilation Error c) 0 d) None of the above
34. What is the output of this program?
classTest
{
publicstaticvoidmain(String[] args)
{
doublex=6;
inty=5,z=2;
x= y++ + ++x/z;
System.out.println(x);
}
}
a) 9 b) 8 c) 8.5 d) None of the above
35. What is the output of this program?
classTest
{
publicstaticvoidmain(String[ ] args)
{
intlength = 100;
int[ ] d = newint[length];
for(intindex = 0; index < length; index++)
System.out.println(d[index]);
}
}
a. The code will not compile because the int[] array is not declared correctly.
b. The code will compile but will throw an IndexArrayOutOfBoundsException when it runs and nothing will appear in the standard output.
c. The code will display the numbers 0 through 99 in the standard output, and then throw an IndexOutOfBoundsException.
d. This code will work fine and display 100 zeroes in the standard output.
36. What is the output of this program?
classTest
{
staticintj=func1();
staticinti=10;
staticintfunc1()
{
returni;
}
publicstaticvoidmain(String[] args)
{
System.out.println("i="+i);
System.out.println("j="+j);
}
}
a. i=10 j=0 b.i=10 j=10 c. Compilation Error d. Run Time Error
37. What is the output of this program?
classTest
{
staticintfunc( int i)
{
return ++i;
}
public static void main(String[] args)
{
int i=0;
int j=i++ + i + func(i++) + ++i
+ func(i++) + i + --i + func(i--) + i + i
+ func(i--) + ++i;
System.out.println(i);
System.out.println(j);
}
}
a. 2,30 b. 2,26 c. 3,26 d. None of the above
38. For execution of DELETE SQL query in JDBC, ...... method must be used.
a. executeQuery() b. executeDeleteQuery()
c. executeUpdate() d. executeDelete()
39. Which is the root class of all AWT events
a. java.awt.ActionEvent b. java.awt.AWTEvent
c. java.awt.event.AWTEvent d.java.awt.event.Event
40. Injava ... can only test for equality, whereas ...... can evaluate any type of the boolean expression.
a. switch, if b. if, switch c. if, break d. continue, if
41. The use of the break statement in a switch statement is
A. optional
B. compulsory
C. not allowed. It gives an error message
D. to check an error
E. None of the above
42. which of the following language is not a procedure oriented programming language?
A. ALGOL
B. COBOL
C. FORTRAN
D. None of the above
43.Which of the following programming approach used functions as a key concept to perform
action-oriented tasks?
a) Structured programming
b) Modular programming
c) Procedure-oriented programming
d) Object-oriented programming
44. Identify the drawback of using procedure-oriented programming, if any:
a) Data is hidden from external functions
b) New functions can be added whenever necessary
c) Does not reflect real world problems
d) All of the above
45. Which is not associated with Object-oriented programming?
a) Data abstraction
b) Automatic initialization
c) Dynamic binding
d) None