alnaceniniya alnaceniniya
  • 21-06-2020
  • Computers and Technology
contestada

predict the output
the following is a segment of program
x=1 y=1
if (n>0)
{
x=x+1
y=y+1
}
what will be the value of x and y if n assumes a value
1 , 0

​

Respuesta :

atolagbeoluwasegun
atolagbeoluwasegun atolagbeoluwasegun
  • 22-06-2020

Answer:

If n is 0, then nothing happens because m is not greater than 0.

If n is 1, then x is 2 and y is 2.

Explanation:

The if condition is true (1>0), so x becomes 1+1 and y becomes 1+1.

Answer Link

Otras preguntas

11 . the account title used for recording the payment of rent in advance for an office building is . question content area bottom part 1 a. prepaid rent b. rent
Hans has a new aquarium. The tank is in the shape of a rectangular prism, 5 ft long, 2 ft wide, and 3 ft deep. He plans to raise fish and sell them to a local p
Two people are at an elevator. At the same time one person starts to walk away from the elevator at a rate of 2 ft/sec and the other person starts going up in t
What temperature should the room be for a Christmas tree?
How long to wait before decorating a real Christmas tree?
What number can you text Santa?
охарактеризуйте державу Карла V
Do Brits still say Happy Christmas?
Explain the relationship between atomic mass and atomic number in your own words (What each one represents, and how they relate)
How do geographic arguments, such as claims, evidence, and reasoning, help geographers communicate and justify their opinions and perspectives?