Q. What is the value of a[1] after the following code is executed?
int[] a = {0, 2, 4, 1, 3};
for(int i = 0; i < a.length; i++)
a[i] = a[(a[i] + 3) % a.length];

  • (A) 0
  • (B) 1
  • (C) 2
  • (D) 2 D. 3
πŸ’¬ Discuss
βœ… Correct Answer: (B) 1
Explanation: Here's an explanation of the code:
Explanation by: Ranjeet
Here's an explanation of the code:

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
104
Total Visits
πŸ“½οΈ
1 y ago
Published
πŸŽ–οΈ
Ranjeet
Publisher
πŸ“ˆ
85%
Success Rate