Solved

Given the Following Code Snippet: Public Static Int NewCalc(int N)

Question 98

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(15) ?


A) 2
B) 2.5
C) 5
D) 5.5

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions