Answered step by step
Verified Expert Solution
Link Copied!

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Fundamentals Of Database Management Systems

Authors: Mark L. Gillenson

2nd Edition

0470624701, 978-0470624708

More Books

Students also viewed these Databases questions

Question

$1080 Favorable 52.680 Favorable $1,600 Unfavorable $1418 Favorable

Answered: 1 week ago