Find and correct the error(s) in each of the following segments of code:
a)For(i =100, i >=1, i++)
System.out.println(i);
b) The following code should print whether integer value is odd or even:
switch(value %2)
{
case0:
System.out.println("Even integer");
case1:
System.out.println("Odd integer");
}
c) The following code should output the odd integers from 19 to 1:
for(i =19; i >=1; i +=2)
d) The following code should output the even integers from 2 to 100:
counter =2;
do
System.out.println(counter);
counter +=2;
}While(counter100);
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here