Question: factorial program in php using do while loop?
Answer: Factorial program using For Loop php $fac_num = 6; $factorial = 1; for ($x=$fac_num; $x>=1; $x--) { $factorial = $factorial * $x; } echo "Factorial of $num is $factorial"; ?>