Question: Write a program that calculates n!!. n!! is the double factorial and is defined as n!! = {n(n - 2)(n - 4) ... 1 odd

 Write a program that calculates n!!. n!! is the double factorial

Write a program that calculates n!!. n!! is the double factorial and is defined as n!! = {n(n - 2)(n - 4) ... 1 odd n n(n - 2)(n - 4) ... 2 even n Ask the user for the integer n. If n is negative, output an error message. Use a for-loop. Examples: 5!! = 15 and 8!! = 384

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!