Question: edlingT Heading2 Heading 3 Title Subtle Em... . Emphasis Intense E Styles Using the for Looping (Repetition) Structure design a program that prompts the user
edlingT Heading2 Heading 3 Title Subtle Em... . Emphasis Intense E Styles Using the for Looping (Repetition) Structure design a program that prompts the user to enter a positive integer number. Use a for loop to calculate and display the factorial value of that number. A factorial number is a number multiplied by every factor between 1 and the number, inclusive. For instance, 3 factorial is 3 2 *1. If the user enters negative number, display a message indicating that the program calculates only positive numbers. Otherwise, display the result of the calculation. // Enter,your name as a comment for program identification II Program assignment Factorial.cpp // Enter your class section, and time /* The program Factorial1.cpp is a program that prompts the user to enter a positive integer number The program will then use a for loop to calculate and display the factorial value of that number. This in the for loop. A factorial number is a number multiplied by every factor between 1 and the number inclusive. For instance 3 factorial is 321. if the user enters a negative number, display a message indicating that the program cakculates only positive numbers. Otherwise, display the result of the calculation. The input is a positive integer number. The factorial value of the numbe er entered or a message indicating that the number is not positive. // header files use the correct preprocessor directives for input/output // declare variables /- declare an integer variable number to input a value and a integer variable factorial initialized to 1 to calculate the factorial value of the number entered
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
