Top Posters
Since Sunday
5
o
5
4
m
4
b
4
x
4
a
4
l
4
t
4
S
4
m
3
s
3
New Topic  
Eels Eels
wrote...
Posts: 716
Rep: 0 0
7 years ago
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
Textbook 
Starting Out with Java: Early Objects

Starting Out with Java: Early Objects


Edition: 4th
Author:
Read 81 times
3 Replies
Replies
Answer verified by a subject expert
ToothyToothy
wrote...
Top Poster
Posts: 744
Rep: 4 0
7 years ago
Sign in or Sign up in seconds to unlock everything for free
More solutions for this book are available here
1

Related Topics

Eels Author
wrote...
7 years ago
YOU'RE AWESOME
wrote...
7 years ago
Good luck tackling the rest
New Topic      
Explore
Post your homework questions and get free online help from our incredible volunteers
  1037 People Browsing
Related Images
  
 4416
  
 26
  
 65
Your Opinion
Which industry do you think artificial intelligence (AI) will impact the most?
Votes: 308

Previous poll results: Where do you get your textbooks?