Loop Example: Factorials
Factorials may also be calculated using loops.
Recall that n! = 1*2*3* ... *(n-1)*n.
// Yield n factorial.
public static int fact(int n)
{
// Fill in code here ...
}
Previous slide
Next slide
Back to first slide
View graphic version