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

In bud not buddy how did rule 63 help bud survive
What two numbers multiply to get 54 and add to get 36?
How does the U.S. Constitution reflect the principle of democracy? It creates a republic government, which is the same as democracy. Most of the people can elec
how do you use manacles in a sentence? I
Which sentence uses all its subject pronouns correctly? A. Ronald and they are growing vegetables in the backyard. B. Her and me decorated the house for the
Rachel wants to reduce the size of her photo which factor listed the below would scale down (reduce) the size of her picture the most
how do i simplify 2a x 3b x 4c
What two numbers multiply to get 54 and add to get 36?
Why is rosa parks an important and inspirational woman?
How do scientists use recombinant DNA technology to produce the drug insulin?