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

HELP ASAP!!!!PLEASE
how does the bonding between parents and a child develop?someone please helpthis is child development class​
The situation in 1950s Latin America can best be compared to what other time and place?
100 Points!!!! Please HELP!!! The Summit at Snoqualmie Ski Resort is a popular ski destination, especially with snowboarders. Last weekend, the resort had to sh
1. What point of view does the author convey in the article? a. running a rooftop farm is highly profitable. b. large cities can take advantage of the benefits
What might happen if a school is negligent in keeping proper records in a case of suspected child abuse? The school would be involved in a legal dispute. The sc
39. The table shows the average U.S. crude oil imports in thousands of barrels per day. (8 points total) Determine the correlations coefficient, r, for a linear
why has mythology the role of mythology changed over time
1/4of an inch is equal to how many inches
Joseph and his children went into a movie theater where they sell bags of popcorn for $7.50 each and pretzels for $4.75 each. Joseph has $95 to spend and must b