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 are the dimensions of the foot ball feild in feet?
At a basketball game, a vender sold a combined total of 116 sodas and hot dogs. The number of sodas sold was three times the number of hot dogs sold. Find the n
Which sentence from "president and chief justice" explains why taft eventually lost favor with other politicians in his party?
Read the excerpt from Act II, scene iii of Romeo and Juliet. Friar Laurence: The grey-ey’d morn smiles on the frowning night, Chequering the eastern clouds with
Abcdefghijklmnopqrstuvw_yz
If 5 people entered a game, and then 6 people entered the same game. Then some people entered a different game, at the end 14 people were in games. Then twice t
PLEASE SHOW YOUR WORKING OUT THANKS There are 64 cards in a pack. Each card is either red or black. The ratio of the number of red cards to the number of blac
What process is considered to be growth when it occurs in multicellular organism reproduction when it occurs in a unicellular organism ?
What is the next item in the pattern ...... -1,2,-4,8?
Given 3 moles of gold, au, how many grams do you have?