Directions: Study the following information carefully and answer the following question.
Input: 3 2 7 9 4 2 5 9 2 4 1 6 2 3 9 6 9 8 3 1 6 4 2 7 9 4 8 2
Step I: All such 2’s which is immediately preceded by an even number and immediately followed by a prime number is to be placed immediate right of that prime number.
Step II: All digits greater than 5 are subtracted by 1, whereas all digits less than 5 are increased by 1.
Step III: Add ‘2’ to all prime numbers which are immediately followed by an even number. Step III is the final output.
Q. How many numbers (non-prime) are immediately preceded by a prime number and immediately followed by an even number in step III?
A. Three
B. One
C. More than three
D. None
E. None
Sol:
We have:
Input: 3 2 7 9 4 2 5 9 2 4 1 6 2 3 9 6 9 8 3 1 6 4
2 7 9 4 8 2
For step I: All such 2’s which is immediately preceded by an even number and immediately followed by a prime number is to be placed immediate right of that prime number.
Step I: 3 2 7 9 4 5 2 9 2 4 1 6 3 2 9 6 9 8 3 1 6 4
7 2 9 4 8 2
For step II: All digits greater than 5 are subtracted by 1, whereas all digits less than 5 are increased by 1.
Step II: 4 3 6 8 5 5 3 8 3 5 2 5 4 3 8 5 8 7 4 2 5 5
6 3 8 5 7 3
For step III: Add ‘2’ to all prime numbers immediately followed by an even number.
Step III: 4 5 6 8 5 5 5 8 3 7 2 7 4 5 8 7 8 9 4 2 5
7 6 5 8 5 7 3
Q. What is the sum of the twelfth element from the left end and the ninth element from the right end in step III?
A.9
B.11
C.13
D.7
E. None of these
Sol:
We have:
Input: 3 2 7 9 4 2 5 9 2 4 1 6 2 3 9 6 9 8 3 1 6 4
2 7 9 4 8 2
For step I: All such 2’s which is immediately preceded by an even number and immediately followed by a prime number is to be placed immediate right of that prime number.
Step I: 3 2 7 9 4 5 2 9 2 4 1 6 3 2 9 6 9 8 3 1 6 4
7 2 9 4 8 2
For step II: All digits greater than 5 are subtracted by 1, whereas all digits less than 5 are increased by 1.
Step II: 4 3 6 8 5 5 3 8 3 5 2 5 4 3 8 5 8 7 4 2 5 5
6 3 8 5 7 3
For step III: Add ‘2’ to all prime numbers immediately followed by an even number.
Step III: 4 5 6 8 5 5 5 8 3 7 2 7 4 5 8 7 8 9 4 2 5
7 6 5 8 5 7 3
Q. If all the prime numbers are dropped from step III, then which of the following element is fifth to the left of the second perfect square number from the right end?
A.6
B.1
C.4
D.8
E. None of the above
Sol:
We have:
Input: 3 2 7 9 4 2 5 9 2 4 1 6 2 3 9 6 9 8 3 1 6 4
2 7 9 4 8 2
For step I: All such 2’s which is immediately preceded by an even number and immediately followed by a prime number is to be placed immediate right of that prime number.
Step I: 3 2 7 9 4 5 2 9 2 4 1 6 3 2 9 6 9 8 3 1 6 4
7 2 9 4 8 2
For step II: All digits greater than 5 are subtracted by 1, whereas all digits less than 5 are increased by 1.
Step II: 4 3 6 8 5 5 3 8 3 5 2 5 4 3 8 5 8 7 4 2 5 5
6 3 8 5 7 3
For step III: Add ‘2’ to all prime numbers immediately followed by an even number.
Step III: 4 5 6 8 5 5 5 8 3 7 2 7 4 5 8 7 8 9 4 2 5
7 6 5 8 5 7 3