Examlex

Solved

Given the Following Code Snippet

question 30

Multiple Choice

Given the following code snippet:
Public static int newCalc(int n)
{
If (n < 0)
{
Return -1;
}
Else if (n < 10)
{
Return n;
}
Else
{
Return (1 + newCalc(n / 10) ) ;
}
}
What value will be returned when this code is executed with a call to newCalc(5) ?


Definitions:

Related Questions