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

Is my answer right for this question?
Why both women could become voctim of violence?
i need help with this problem for homework
Which pamphlet written by Thomas Paine sparked the ideas behind revolting against the government?
explain why choosing a shy personality would make being a ventriloquist easier?
PLEASE ANSWER Solve this problem: 2+.75x<10
how many minutes are in 91/4 hours?
Two cones have a radius of 3 centimeters. The height of one cone is 12 centimeters. The other cone is 1/3 that height. Which of these statements is NOT true?
What major river flows through northwestern brazil?
What happens if plant cells lose water through osmosis?