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

Last one for the day :)Find the slope of the line
inequalities x+3 <=10
Al's Awesome Autos advertised a special sale on cars - Dealer cost plus 5%!! jack and Margaret bought a luxury sedan for $23,727.90.what was the dealers cost? p
What happens when a glass rod is dipped in HCl and is brought near ammonia gas?
HELP ! Find the Domain in this question
differentiate between plant cell and animal cell prokaryotic cell eukaryotic cell
Relationship between mini and kabuliwala
Find the domain. f(x) = 9x - 8
what happens when red lead oxide is heated?
The running time for movie A is 33 mins more than twice the running time for movie B. If the running time for movie A is subtracted from triple the running time