Ask Question
18 July, 02:55

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

+3
Answers (1)
  1. 18 July, 06:10
    0
    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.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “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 ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers