object Result {
/*
* Complete the 'factorial' function below.
*
* The function accepts INTEGER input1 as parameter.
*/
def factorial(n: Int) =
{
// Put your code here
def iter(n:Int,accum:Int):Int =
if(n==0) accum else iter(n-1,n*accum)
iter(n,1)
}
}
Im also not getting any output in the stdout. How to solve this, anyone help. What is wrong in it