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

Describe some possible strategies for keeping fans engaged during team losing streak
Can I get some help on putting these in better sentences
Can someone explain to me how to find the vertex form of this equation? y= -x^2 + 12x-4 Do i use the -b/2a formula? I just need this to be explained better bia
how to factorize (1-x)(4x-9)+(x^2-6x+5)
Complete the point-slope equation of the line through (2,3) and (7,4) . y−4=?
engineering mechanics statics
What landform is circled on the map above? A. the Atlas Mountains B. the Namib Desert C. the Sahel D. the Sahara Desert please help
When tourism generates dollars that are not respent in the area, it is referred to as ________?
What was the chief economic connection between south and north?
Allison, a long-time employee at aim corporation is helping william, a new employee; learn the culture of the organization. allison is using the