Explore what CodeHS has to offer for districts, schools, and teachers.
Click on one of our programs below to get started coding in the sandbox!
View All
Given the following function:
public void mystery(int a) { if (a % 10 < 5) { System.out.println(a); } else { mystery(a / 10); } }
What will the output be if mystery(893498) is called?
mystery(893498)
4
3
89
893
8934