Question: Which of the following for statements is valid? Select the one correct answer. (a) int j = 10; for (int i = 0, j +=

Which of the following for statements is valid?

Select the one correct answer.

(a) int j = 10; for (int i = 0, j += 90; i < j; i++) { j-

-; }

(b) for (int i = 10; i = 0; i--) {}

(c) for (int i = 0, j = 100; i < j; i++, --j) {;}

(d) int i, j; for (j = 100; i < j; j--) { i += 2; }

(e) int i = 100; for ((i > 0); i--) {}

Step by Step Solution

3.42 Rating (155 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

c Only c contains a valid for loop The initialization in a for statement can contain either declar... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Java Programming 8th Questions!