Ask a New Question

Question

Consider the following code.
public void printNumbers(int x, int y) {
if (x < 5) {
System.out.println("x: " + x);
}
if (y > 5) { System.out.println("y: " + y);
}
int a = (int)(Math.random() * 10);
int b= (int)(Math.random() * 10);
if (x != y) printNumbers(a, b);
}
Which of the following conditions will cause recursion to stop with certainty?
x < 5
x < 5 or y > 5
x != y
x == y
5 years ago

Answers

oobleck
the only time recursion occurs is if x != y
so ...
5 years ago

Related Questions

icd-9-cm injury code and e codes for motor vehicle accident due to loss of control, and crashing int... Consider the following code. public static int recur3(int n) { if (n == 0) return 0; if (n == 1... What was the code name for the government program in which an atomic bomb was designed and construct... Hammurabi’s code was a code of _______. Please help me. How could the following code be adapted for a baseball score keeping? 1 def scoreUpdate(value): 2 #... What will the following code print? try: 5/0 except ZeroDivisionError: print("Ca... Why was the Code Talkers' code so hard to break? (1 point) Responses It was based on a language... Consider the following code segment, which is intended to assign to num a random integer value betwe... what is the e/m code for this scenario? Systemic lupus erythematosus with development of edema. H...
Ask a New Question
Archives Contact Us Privacy Policy Terms of Use