Factorial calculator!

In this exercise I had to ask the user for a positive number and display its factorial. The program had to continue running until the user indicated it to stop by answering “n” to the question “would you like to try again?”.

For this, I used if-else and a loop, both of which I have discussed in previous exercises (You can check it out specifically here!).

You can look at the code I made for this:factorial

And how it runs:

factorial-run

3 thoughts on “Factorial calculator!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s