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

Summarize "The Model Millionaire" in no more than two sentences.
why is velocity most important in space launch?
The greenhouse effect is caused by a. co2 traps heat in from from the sun b. causes the temp of earth to increase c. all of above d. none of the above
In need of help please thank you!
Which shows how to best estimate the product of 4.73 x 8.92?
The price of a new home is $126,000. The value of the home appreciates 2% each year. How much will the home be worth in 10 yr?
Assume you have a 5 percent sales tax on the price of a banquet, a 15 percent gratuity charge, and a 5 percent over/under policy. Explain to your client the cos
Determine the value of k for which -3x^2+12x+k=0 has no real roots. ​
Read the excerpt from "I'm Not Thirteen Yet" by Amy Bernstein. After the game, we had an ice cream party in the dining hall to celebrate our victory. I sprinkle
Poppy Gloria or Poppy Smoria