Int g( int x,int y){switch (x-y){case 0:return x;case 4:y =y+ 1;break;case 7:x=x-1;case9:return x * y;case3:y=x+9;default;return y-x;}return y;}what does g(3,0) evaluate to?
Answers
Answered by
6
Answer:
so, x-y =3.it relates with case 3.
in case 3 : y = 3+9 = 12.
but then no break command found.
so it steps down and go to default.
in default, return y-x, which is 12-3 =9,
so it evaluates and return 9 at the end.
Answered by
0
Answer:
case 3 will execute
x=3 y=0
y=x+9
y=3+9
y=12
return y-x
return 12-3
return 9
Similar questions