Given the code fragment:
Which option can replace xxx to enable the code to print 135?
A.
int e = 0; e < = 4; e++
B.
int e = 0; e < 5; e + = 2
C.
int e = 1; e < = 5; e + = 1
D.
int e = 1; e < 5; e+ =2
Given the code fragment:
Which option can replace xxx to enable the code to print 135?
A.
int e = 0; e < = 4; e++
B.
int e = 0; e < 5; e + = 2
C.
int e = 1; e < = 5; e + = 1
D.
int e = 1; e < 5; e+ =2
Answer is B. e needs to begin at 0 to print first element and be incremented by two each iteration for 3 iterations. B does this successfully.
B