Computer Science, asked by gargsharda1959, 1 month ago

Identify the error(s) in the following program:-

(1 Point)

for(i=2;i<=20;i=i+2); { System.out.println(i); } I. i hasn't been declared. II. s of System should be in small letters. III. There should not be any ; after for loop IV. i==2 should be there.​

Answers

Answered by Anonymous
1

Answer:

Here, the correct option is:

III. There should not be any ; after for loop

Explanation:

If there is a semicolon [ ; ] after the for loop, then the for loop does not execute. The Java compiler will ignore all the statements present within the for loop and it will proceed to the statements after the for loop.

Similar questions