You are not logged in.

#1 2015-06-17 06:01:46

husnain
User RankUser RankUser RankUser RankUser RankUser Rank
Administrator
From: Chichawatni,Pakistan
Registered: 2014-10-03
Posts: 8,129
Website

Java Array Code Executed:

Java Quizzes Java Language Array

Directions:
int[] a = {0, 2, 4, 1, 3};
for(int i = 0; i < a.length; i++)
a[ i ] = a[(a[ i ] + 3) % a.length];

Question:
What is the value of a[1] after the following code is executed?

Option A):
2
Option B):
4
Option C):
3
Option D):
1

Correct Answer is Option D):
1


You cannot discover the new oceans unless you have the courage to lose the sight of the shore.

2015-06-17 06:01:46

Advertisement
Ads By Google

Re: Java Array Code Executed:



\n

Board footer