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

What was the significance of the pope’s declaring Charlemagne emperor?
define feudalism and describe the characteristics of its organization.
which expression are a factor of -48xyz - 24xy + 40xyz A. 4 B. 24 C. 3x D. 8y E. 2xy F. 6xy G. xyz
What is the solution set of 2x-5=7-4x
Why was Charles Martel’s victory at the Battle of Tours so important for Christianity?
Francois Jacob and Jacques Monod studied Escherichia coli (E. coli) bacteria by using lab experimentation. What revision to their initial hypothesis did they co
In what ways are hunting-gathering societies and stateless societies similar?
Explain why the decimal moving strategy can be used with SI units, but not with imperial units.
The use of the Marshall Plan in Western Europe after World War II strengthened the forces of (1) democracy (3) isolationism (2) communism (4) autocrac
Samantha is going on vacation for the summer and is trying to choose between two different plans. The first plan costs $450 for 3 days at a hotel and 2 days at