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

How do you multiply fractions
When someone dies, how long does it take for all cells in their body to die?
Where would you be if the Polaris is seen at the zenith?
write a description about a visit to the National Science Exhibition.( no need to write in essay, just easy writing )
3. Tom was using wire of the following thicknesses 0.33 mm, 0.275 mm, 0.25 mm, and 0.3 mm for some electrical work. Order the wire from thickest to thinnest.
Graph Photo attahed The bar graph shows the number of representatives from the North, South, Central, East, and West regions of a city. According to the bar gra
Can you answer the question six times eight
Ariana plans to use $260 less than three- fourths of her savings to buy a car. If the purchase price of the car is $9,340, how much does she have in savings?
Which sentence provides commentary information for elaboration of a concrete detail? A) 8I saw someone eating fried Kool-aid! B) 6You could ride any ride all d
Explain, why pure water conducts electricity.