Layertech Qution Paper 1
Layertech Qution Paper 1
1. Which of the following statements should be used to obtain a remainder after dividing 3.14 by 2.1
A. rem = 3.14 % 2.1;
C. - (hyphen) D. _ (underscore)
C. roundup(1.66) D. Roundto(1.66)
5. Which of the following is the correct order of evaluation for the below expression?
z = x + y * z / 4 % 2 - 1
A. */%+-= B. =*/%+-
C. /*%-+= D. *%/-+=
C. printf('\n'); D. printf("\\n");
7.. How many times the while loop will get executed if a short int is 2 byte wide?
#include<stdio.h>
int main()
{
int j=1;
while(j <= 255)
{
printf("%c %d\n", j, j);
j++;
}
return0;
}
C. Float D. enum
#include<stdio.h>
int main()
{
int i;
#if A
printf("Enter any number:");
scanf("%d", &i);
#elif B
printf("The number is odd");
return0;
}
C. Garbage values
D. None of above
A. 1, 2 B. 4
C. 1, 2, 4 D. 1, 2, 3, 4
11. Process is
A. program in High level language kept on disk
C. a program in execution
C. contains the address of the memory location that is to be read from or stored into.
contains a copy of the designated memory location specified by the MAR after a "read"
D.
or the new contents of the memory prior to a "write".
C. execute first the job that has been in the queue the longest
B. indexed register
C. special location
D. scratch pad
CORE JAVA
16. What is the name of the method used to start a thread execution?
A. init(); B. start();
C. run(); D. resume();
18. Which class or interface defines the wait(), notify(),and notifyAll() methods?
A. Object B. Thread
C. Runnable D. Class
19. Which class does not override the equals() and hashCode() methods, inheriting them
directly from class Object?
A. java.lang.String B. java.lang.Double
C. java.lang.StringBuffer D. java.lang.Character
20. You need to store elements in a collection that guarantees that no duplicates are stored and
all elements can be accessed in natural order. Which interface provides that capability?
java.util.Map
A. B. java.util.Set
C. java.util.List D. java.util.Collection
21. Which is valid declaration of a float?
A. float f = 1F; B. float f = 1.0;
float f = 1.0d;
C. float f = "1"; D.
22 .You want subclasses in any package to have access to members of a superclass. Which is the
most restrictive access that accomplishes this objective?
A. public B. private
C. protected D. transient
23.What is the most restrictive access modifier that will allow members of one class to have
access to members of another class in the same package?
A. public B. abstract
C. protected D. synchronized
E. default access
B. It can extend exactly one class and can implement multiple interfaces.
-2x + y + z = a; x - 2y + z = b; x + y – 2z = c
28. A rectangular box with square base is open at the top. The maximum volume of the box made
from 300 m2 wood is:
a) 500
b) 1000
c) 1500
d) 2000
29. An urn contains 5 red and 10 black balls. 8 of them are placed in another urn. The chance that
the latter then contains 2 red and 6 black balls is:
a) 140/429
b) 129/440
c) 139/420
d) None of these
30. Arrivals at a telephone booth are considered to be Poisson with an average time of 10 min
between successive arrivals. The length of a phone call is distributed exponentially with mean 3
min. The probability that an arrival does not have to wait before service is:
a) 0.3
b) 0.5
c) 0.7
d) 0.9
31. Using bisection method the negative root of x3 – 4x + 9 = 0 correct to 3 decimal places is:
a) -2.506
b) -2.706
c) -2.406
d) None of these
33. An intelligence agency forms a code of two distinct digits selected from 0, 1, 2….. 9 such that the
first digit of the code is non zero. The code hand written on the slip can however potentially create
confusion when read upside down- for example, the code 91 may appear as 16. How many codes
are there for which no such confusion can arise?
a) 80 b) 78
c) 71 d) 69
34. A can complete a piece of work in 12 days and B is 60% more efficient than A. In how many days
B will complete the same work?
A company imports component A from Germany and component B from USA. It then assembles
them along with other components to produce a machine used in a chemical process. Component A
contributes 30% to the production cost and component B contributes 50% to the production cost.
The current practice is to self the machine at a price that is 20% over the production costs. Due to
foreign exchange fluctuations the German Mark has become costlier than US Dollar by 22%. But the
company is unable to increase the selling price by more than 10%.
36) Suppose the US Dollar becomes cheaper by 12% of its original value, and the German Mark
becomes costlier by 20% at its original value. To achieve a profit margin of 10%,the selling price
must exceed the production cost by,
Frankfurt is 5 hours ahead of Boston but 5 hours behind India. For example if it is 10 A.M. on a
particular day in Frankfurt, then it is 5 A.M. on the same day in Boston and 3 P.M. on the same day
in India.
James started at Boston at 6 P.M on Friday and reached Frankfurt on Saturday at 7 A.M. He then
left for India at 12 noon to reach India at 1 A.M. on Sunday.
37) If the total distance between Boston and India is 12000 kms , the average speed of James is
38) On return Journey , if James starts from India at 10 P.M. on Sunday , at what time does he reach
Boston assuming he takes same route but stops at Frankfurt for one hour less?