Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Using a while loop, write a program that calculates the factorial of a number. 5 ! 5 x 4 x 3 x 2 x 1...120.
Using a while loop, write a program that calculates the factorial of a number. 5 ! 5 x 4 x 3 x 2 x 1...120. Use one variable to hold the number of which you want to find the factorial. You can use a while loop to loop through the multiplications until youve reached that number. Use another variable to hold the result during the loop. Finally, use an echo statement to display the result. 1x browser print and code.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started