It is interesting to watch recursion “in action.” Modify the factorial function of, to print
its local variable and recursive call parameter. For each recursive call, display the outputs
on a separate line and add a level of indentation. Do your utmost to make the outputs
clear, interesting and meaningful. Your goal here is to design and implement an output
format that helps a person understand recursion better. Print your output for each of the
following inputs, 5, 6, 7 and turn them in.
here is my code
#include<iostream> using namespace std; int main() { int num, onum; float fact = 1; cout<<"Please enter a number: "; cin>>num; onum = num; cout<<endl; while(num>=1) { fact = fact*num; num = num-1; cout<<"factorial: "<<fact<<endl; } cout<<endl<<"The final factorial of "<<onum<<" is: " <<fact<<endl; system("pause"); return 0; }