In the code segment below, assume that the int variable n has been properly declared and initialized. The code segment is intended to print a value that is 1 more than twice the value of n.
/* missing code */
System.out.print(result);
Which of the following can be used to replace /* missing code */ so that the code segment works as intended?
int result = 2 * n;
result = result + 1;
int result = n + 1;
result = result * 2;
int result = (n + 1) * 2;
I only
A
II only
B
III only
C
I and III
D
II and III
E
Submit