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

For a tubular section with outside diameter 68 mm and inside diameter 49 mm. If the tube was subjected to a torque of 1996 Nm, what would be the maximum stress
You are experimenting with cell division on the root cells in an Allium cepa plant in your lab. Before they can divide the DNA must be copied, but the cells see
What is 0.625 rounded to the nearest tenth
Mr. Patel is in good health and is preparing a budget in anticipation of his retirement when he turns 66. He wants to understand the health care costs he might
Inserting Quotation Marks 1-5
Multiply 4 and 7. Then, divide by q.
Identifying the single solution to a situation or problem is a crucial element of critical thinking. Please select the best answer from the choices provided
21. ROLLER COASTERS The latest thrill ride at a popular theme park takes roller coaster fans on an exciting ride. In the first 20 seconds, it carries its passen
What is the length of a football field from goal post to goal post
How is a warm-up different from a cooldown?