205k views
0 votes
Allison is writing a program in Java and keeps getting an error. Which line of code is causing the error?

A. Int a = 0, b = 3, c;
B. for(i = 0, i <= 13, i++) {
C. c = (a * 2) + i;
D. System.out.println(c);

}

1 Answer

4 votes

B will cause an error.

Allison needs to declare a type for variable i and use semi-colons.

The for statement should be for(int i = 0; i <=13; i++){

User Fred The Fantastic
by
4.2k points