What would be the value of x after the following
code segment compltes execution ?
intx=0;
if (x >=0)
x += 5;
if(x>=5)
X+= 2;
(A) 7
(B) 5
(C) O
(D) 2
Answers
Answered by
1
Answer: Sorry, but no Output.
Explanation: There's no Statement in the Code for Displaying the Output.
Rather, if the statement for displaying the output is at the last, then the output will be 7.
Hope it Helped all...Please rectify the Code...:-)
Answered by
1
it will have no output but if there is a print statement then answer would be x,=7
geekyboy134:
The answer is correct but can you please tell me in brief
Similar questions