Showing 51–55 of 55 questions
In a sequence, each term is obtained by adding the previous two terms. If the 1st term is 2 and 2nd term is 3, what is the 6th term?
Explanation:
Fibonacci-like sequence: T1=2, T2=3, T3=5, T4=8, T5=13, T6=21. Each term = sum of previous two terms.
If PAPER is coded as 16-1-16-5-18, then PENCIL would be coded as?
A
16-5-14-3-9-12
B
16-5-13-3-9-12
C
15-5-14-3-9-12
D
16-5-14-2-9-12
Correct Answer:
A. 16-5-14-3-9-12
Explanation:
Each letter is coded as its position in the alphabet: P=16, A=1, P=16, E=5, R=18. Similarly, PENCIL: P=16, E=5, N=14, C=3, I=9, L=12.
Four friends A, B, C, and D have different salaries. C earns more than A but less than D. B earns more than D. Who has the highest salary?
Explanation:
From given conditions: A < C < D and D < B. This means B > D > C > A. Therefore, B has the highest salary.
What will be the output of the following code snippet?
int x = 5;
int y = ++x + x++ + x;
System.out.println(y);
Explanation:
++x makes x=6, then 6 is added. x++ uses 6 then increments to 7. Finally +x adds 7. So: 6 + 6 + 7 = 19.
A can complete a task in 12 days. B can complete the same task in 18 days. If both work together, in how many days will they complete the task?
A
7.2 days
B
6.8 days
C
7.5 days
D
8 days
Correct Answer:
A. 7.2 days
Explanation:
A's work rate = 1/12, B's work rate = 1/18. Combined rate = 1/12 + 1/18 = 3/36 + 2/36 = 5/36. Time = 36/5 = 7.2 days.