Question: Do not use Arrays or Pointers. Write in C++ Code. Goals: Practicing loop/repetition structures and functions Create a program that will calculate the factorial of
Do not use Arrays or Pointers. Write in C++ Code.
Goals: Practicing loop/repetition structures and functions Create a program that will calculate the factorial of a positive number using a function that you build. Your main function should prompt the user to enter a positive whole number and robustly confirm the number is greater than zero. (You may assume the number is a whole number and do not have to check that the number is whole.) Then your code should call the function to calculate the factorial, store the value returned from the function in a variable. Next main should output the original number and the factorial. Do not put the function call in a cout statement. Your function should accept the whole number as a parameter, then use a loop to calculate the factorial. The resultant factorial should be returned to main function for output.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
