Pls solve fast.. Java.. Methods/Function
Attachments:
Answers
Answered by
0
Explanation:
State the output of the following program:
class Recur
{
public static void main(String args[ ])
{
int Result = result(10);
System.out.println("Result = " + Result);
}
static int result(int m)
{
if(m <= 2)
return m;
else
return m + result(m-2);
}
}
Similar questions
Computer Science,
3 hours ago
Math,
3 hours ago
Math,
3 hours ago
Computer Science,
5 hours ago
Hindi,
5 hours ago
Math,
8 months ago
English,
8 months ago
Hindi,
8 months ago