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 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
Get step-by-step solutions from verified subject matter experts
