For each call of the method below, display the value that is returned
public int retVal(int a, int b) {
int c;
if (a > b) {
c = a;
} else if (b % a == 0) {
c = b;
} else {
c = b + (a - (b % a));
}
return c;
Read the following arguments from the keyboard and pass them to retVal()
Arguments passed
Output
For d and e what values are passed to produce 20 and 8?
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here