The following program segment calculates and displays the factorial of a number. [Example: Factorial of 5 is \(1 \times 2 \times 3 \times 4 \times 5 = 120\)]
\texttt{int P, n = 5, f = 0;}
\texttt{for (P = n; P>0; P--)}
\texttt{\{}
\texttt{\ \ \ \ f *= P;}
\texttt{\}}
\texttt{System.out.println(f);}