Top Posters
Since Sunday
y
2
s
2
2
a
1
w
1
w
1
i
1
m
1
s
1
c
1
k
1
1
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 97 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
  1012 People Browsing
 156 Signed Up Today
Related Images
  
 4464
  
 101
  
 331
Your Opinion