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 is the polymerase chain reaction useful in dna fingerprinting?
Atlanta had the following temperatures recorded for the last nine days of February: 44, 49, 39, 43, 50, 44, 45, 49, 51 For this data, which summary statistic in
Why did members of the Cherokee Nation most likely refer to the Dahlonega gold rush
If x = 12.8, what is the value of 2(z - 4)? [Type your answer as a number.] need help
Question 3 please!!!!&
Please Help Me! I'm not so good with trigonometry! Will mark the Brainliest!!! Amanda and Jeremiah are standing on the same side of a large lake. They are sep
Which planet has a distinctive red spot? A. Mercury B. Venus C. Jupiter D. Mars
Kiran and his cousin work during the summer for a landscaping company. Kiran's cousin has been working for the company longer, so his pay is 30% more then Kiran
The author uses dialogue to contribute to the plot's rising action by a. having Lennie attack Curley's wifeb. preventing Candy from killing his dogc. having Geo
PLEASE SOMEONE HELP ME PLZ QUICKLY