What is the logic error in this loop?
int i;
for(i=10;i>=0;i-=2)
System.out.print(i);
Answers
Answer:
You should also specify whether the error is a compilation error or a logical error. (a) if (y=1) System.out.println("One candidate only"); (b) if ( x < y) if ( x < z ) ... (c) if (x && y <= 1) System.out.println ("x and y both are smaller than 2"); (d) if ( x == y || x ... (a) for (int i = 1; i <= 10; i++) { System.out.println("i = " + i); } (b) for (int i = 0;
Explanation:
You should also specify whether the error is a compilation error or a logical error. (a) if (y=1) System.out.println("One candidate only"); (b) if ( x < y) if ( x < z ) ... (c) if (x && y <= 1) System.out.println ("x and y both are smaller than 2"); (d) if ( x == y || x ... (a) for (int i = 1; i <= 10; i++) { System.out.println("i = " + i); } (b) for (int i = 0; ..
Explanation: