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;
Responses
I only
I only
II only
II only
III only
III only
I and III
I and III
II and III