This preview shows page 1. Sign up to view the full content.
Unformatted text preview: procedure. Let the user enter the value n . If an overflow occurs in your loop when calculating each factorial value, your program should display an error message. If no overflow occurs, display the calculated factorial. Following is a sample of the interaction between the user and the program: Enter the value of n to calculate the factorial (1 to quit): The factorial is: 1 Enter the value of n to calculate the factorial (1 to quit): 1 The factorial is: 1 Enter the value of n to calculate the factorial (1 to quit): 5 The factorial is: 120 Enter the value of n to calculate the factorial (1 to quit): 12 The factorial is: 479001600 Enter the value of n to calculate the factorial (1 to quit): 13 Error: Calculated value cannot fit into 32 bits Enter the value of n to calculate the factorial (1 to quit): 1...
View
Full
Document
This note was uploaded on 09/08/2010 for the course CMPE 46 at San Jose State University .
 '10
 Cirimele,FrankR

Click to edit the document details