Biology Forums - Study Force

Science-Related Homework Help Computer Studies Topic started by: Eels on Dec 16, 2016



Title: What will be the values of ans, x, and y after the following statements are executed?int ans = 0, x ...
Post by: Eels on Dec 16, 2016
What will be the values of ans, x, and y after the following statements are executed?

int ans = 0, x = 15, y =25;
if ( x >= y)
{
   ans = x + 10;
   x -=y;
}
else
{
   ans = y + 10;
   y += x;
}

A) ans = 0, x = 15, y = 25
B) ans = 25, x = -10, y = 25
C) ans = 25, x = 15, y = 40
D) ans = 35, x = 15, y = 40


Title: Re: What will be the values of ans, x, and y after the following statements are executed?int ans = ...
Post by: Toothy on Dec 16, 2016
Content hidden


Title: Re: What will be the values of ans, x, and y after the following statements are executed?int ans = 0, x ...
Post by: Eels on Jan 31, 2017
YOU'RE AWESOME


Title: Re: What will be the values of ans, x, and y after the following statements are executed?int ans = 0, x ...
Post by: Toothy on Mar 16, 2017
Good luck tackling the rest