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

Determine whether the statement is true or false. 12∈{18,17,15,13,12}
Which of the following correctly describes the relative air pressure at the center of a hurricane, with respect to the horizontal direction? Group of answer cho
The flight from Boston to San Francisco takes 6 hours. You leave Boston at 8:00 am What time will it be in Boston when you land? What time will it be in San Fra
What is the GCF of 15x + 3
Please help, due tomorrow correct the errors
- 3/5 + - 8/2 = in simplified way.
When Braj first enters his swimming pool, the water feels uncomfortably cold. Five minutes later, it feels comfortable to Braj . This is an example of
5. actores de cine (HINT: For English and Spanish, actors are male and actresses are female). * Your answer Answer choices:A.el B.los C.las D.la
A firm produces its products by a continuous process involving three production departments, 1 through 3. Present entries to record the following selected trans
Information overload, time, emotions, and use of slang are considered to be: potential barriers to communication. communication tactics. necessary communication