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

Find the quotient -7 divided by 14/3
Find the value of k such that the equation of the tangent line to f(x) = x^2 + k*x is equal to y = 5*x + 3
Which action is taken by an offensive player in the game of lacrosse?
Which of the following was a characteristic of the German Empire? a. Weak federation of states b. Socialist government c. Strong central government d. Enfor
Why is there a natural limit to human population growth? a. Humans cannot impact limiting factors, so population growth must be limited. b. Human population g
What is the value of 4 cubed
Your friend spends most of his free time eating junk food and playing games on the computer. He has a very low energy level and many aches and pains. which way
Suppose the total cost for n tickets is $36 what's is the total cost of one more ticket is purchased
Which one of the following is the catalyst in a metabolic pathway? a. Carbohydrates b. Phosphate groups c. Enzymes
alaska has land are about 1,700,000 sq kilometers. Florida has a land are 1/10 the size of alaska. what is the land area of Florida? explain how u found the ans