awesomegamerlikeboss
awesomegamerlikeboss awesomegamerlikeboss
  • 09-07-2021
  • Mathematics
contestada

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; }

Respuesta :

AliceBrainly21
AliceBrainly21 AliceBrainly21
  • 09-07-2021

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"

Answer Link

Otras preguntas

Solve for x. A. 37 B. 27 C. 30 D. 31
What year was it when I was a freshman if I graduated this year(2021)?
HELP HELP HELP HELP I'LL GIVE BRAINLIEST!!Assume that you are an engineer by profession and that you are trained to invent new technologies that can make life e
Invisible damage to the body resulting from repeating a movement often is a
What kind of evidence exists for the Bantu expansion? A. Agricultural evidence OB. Religious evidence C. Written evidence O D. Linguistic evidence
4x squared - 35 y squared ​
d. What do you think are the qualities of men that helped them to form better and better societies to reach to this modern society and animals remain wild?​
A shipping container is in the shape of a right rectangular prism with a length of 2.5 feet, a width of 13 feet, and a height of 11 feet. The container is compl
what did you learn about your creative skills on making a face shield. 5 points​
Is Liesel a “thief”? Cite evidence from the novel to justify your answer. (The Book Theif)