Share
The programming code below shows an ”if-else” function. After the code is run, the variable ”y” is equal to _______. int x,
Question
The programming code below shows an ”if-else” function. After the code is run, the variable ”y” is equal to _______.
int x, y;
x = 0; y = 0;
if (x < 0) { y = y + 1; }
else { y = y + 2; }
in progress
0
Mathematics
3 years
2021-07-23T15:40:07+00:00
2021-07-23T15:40:07+00:00 1 Answers
10 views
0
Answers ( )
Answer:
2
Step-by-step explanation:
Since x=0, and it’s not <0, the “else statement” is executed making y=0+2
There is a category called “computer and technology”, maybe you can get better answers if you select that instead of “mathematics”