.
Wnat will be the output of the following C code ?
int x=-5, y = 10;
if(x>y)
if (x <0)x=x*-1;
else x=2*x;
else x + = 3*x;
(A) -20
(B) -10
(C) -15
(D) -5
S()
Answers
Answered by
5
• May be -15 is the answer of your question.
geekyboy134:
it's -20 but how to solve this ?
Answered by
0
Answer:
-20
Step-by-step explanation:
Since x is not greater than y it will not go to the first bigger if loop.
It will go to the last else state which says
x = x+ 3x
ie x = -5+3×-5
= -20
Hope this helps you
Similar questions