write a JSP program to find factorial of given number
Answers
Answered by
16
Using Recursion in JSP .Here i get a factorial of a number using recursion .
Code:
<HTML>
<HEAD>
<TITLE>Recursion</TITLE>
</HEAD>
<BODY>
<H1>factorial number Using Recursion</H1>
<%!
int numberfactorial(int number)
{
if (number == 1) {
return number;
}
else {
return number * numberfactorial(number - 1);
}
}
%>
<%
out.println("The factorial of 5 is " + numberfactorial(5));
%>
</BODY>
</HTML>
Answered by
9
please mark as brainlist
Attachments:
aaryashgaikwad47:
i give 2 part
Similar questions