Which option can replace xxx to enable the code to print 135?

Given the code fragment: Which option can replace xxx to enable the code to print 135?

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



Leave a Reply 8

Your email address will not be published. Required fields are marked *


mrtsilva

mrtsilva

Correct Answer is B with the change: ( remove space + = to +=)

TC

TC

Right answer is B

Tomas

Tomas

Answer: B

// A int e = 0; e < 4; e++ – 1234
// B int e = 0; e < 5; e += 2 – 135 – OK
// C int e = 1; e <= 5; e += 1 – error
// D int e = 1; e < 5; e += 2 – 24