Subscribe

RSS Feed (xml)

Powered By

Skin Design:
Free Blogger Skins

Powered by Blogger

Sunday, December 2, 2007

java code for While: Finding a Factorial



Finding a Factorial



Finding a Factorial


<%
int value = 6, factorial = 1, temporaryValue = value;

while (temporaryValue > 0) {
factorial *= temporaryValue;
temporaryValue--;
}

out.println("The factorial of " + value + " is " + factorial + ".");
%>

No comments: