Consider the following code blocks.
A. for (i=0; i<1000; i++)
\(\hspace{1cm}\) statement block;
B. for (i=0; i<100; i+=2)
\(\hspace{1cm}\) statement block;
C. for (i=1; i<1000; i*=2)
\(\hspace{1cm}\) statement block;
D. for (i=0; i<10; i++)
\(\hspace{1cm}\) for (j=0; j<10; j++)
\(\hspace{2cm}\) statement block;
Arrange the number of iterations of the above loops (number of times 'statement block' is executed) in ascending order.
Step 1: Evaluate each loop's number of iterations.
- **A:** The loop runs from \(i=0\) to \(i<1000\) with an increment of 1. Therefore, it runs 1000 times.
- **B:** The loop runs from \(i=0\) to \(i<100\) with an increment of 2. Therefore, it runs 50 times.
- **C:** The loop runs from \(i=1\) to \(i<1000\) with an increment where \(i\) is multiplied by 2 each time. Therefore, the loop runs approximately 10 times (\(i = 1, 2, 4, 8, \dots\)).
- **D:** This is a nested loop. The outer loop runs 10 times, and for each iteration of the outer loop, the inner loop runs 10 times. Therefore, the loop runs \(10 \times 10 = 100\) times.
Step 2: Arrange the number of iterations in ascending order.
- **B** has 50 iterations.
- **D** has 100 iterations.
- **A** has 1000 iterations.
- **C** has approximately 10 iterations.
Thus, the correct order of iterations is **B, A, D, C**, which corresponds to option (3).
Consider the following four words, out of which three are alike in some manner and one is different.
(A) Arrow
(B) Missile
(C) Sword
(D) Bullet
Choose the combination that has alike words.
Find the next two terms of the series:
The given series is: \( A, C, F, J, ? \).
(A) O
(B) U
(C) R
(D) V
Choose the correct answer from the options given below:
