Question: how to do it bu using C progam Concepts to Practice For loops Do/while loops Switch Description For the prelab assignment, you may not use
how to do it bu using C progam

Concepts to Practice For loops Do/while loops Switch Description For the prelab assignment, you may not use the if statement nor may you use the if/else statement. You are to write a program that calculates factorials from 1 up to and including a maximum number given by the user. Because factorials get large quickly, use long unsigned int as the type for the number entered by the user as well as the factorials you are calculating. If the user enters a 0, print an error message. Hints: Just avoid extremely large numbers by only entering maximums that are 20 or less. If you need a reminder on what a factorial is, see https://en.wikipedia.org/wiki/Factoria Sample Output 1 (bold and underline shows user input) JimR@JimRArea51:$ compile prelab3.c JimR@JimRArea51:$ ./a.out Enter the highest factorial you wish to calculate: 5 Calculating factorials up to 5 5!120 Enter e to quit or 1 to continue: 1 Enter the highest factorial you wish to calculate: 12 Calculating factorials up to 12 41 = 24 5!120 6!720 75040 8-40320 9362880 10!- 3628800 11 ! = 39916800 12!- 479001600 Enter e to quit or 1 to continue: 1 Enter the highest factorial you wish to calculate: ** Error: You must enter a positive number Enter 0 to quit or 1 to continue: e Thanks for playing
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
