#include using namespace std; void printfactorial(int factcounter, int factvalue){ int nextcounter; int nextvalue; if (factcounter == 0) { // base case: 0! = 1 cout << "1" << endl; } else if (factcounter == 1) { // base case: print 1 and result cout << factcounter << " = " << factvalue << endl; } else { // recursive case cout << factcounter << " * "; nextcounter = factcounter - 1; nextvalue = nextcounter * factvalue; /* your solution goes here */ } } int main() { int userval; cin >> userval; cout << userval << "! = "; printfactorial(userval, userval); return 0; }
Get the answer
Category: geography |
Author: Selma Yafa
Related Questions
#include using namespace std; void swap1(int n1, int n2) { int temp =

#l2 letter to the editor television and motion pictures have been dist

$ which word in the sentence below is a possessive noun?iei found som

Category
art
$ where t is the number of a =500 the milligrams of aspirin in a person's body is given by the equation hours since the patient took the medicine. ho
art
$ $ the circle graph below shows the percent of students in jim's class that prefer each sport. baseball: 30% basketball: 15% soccer: 10% x football:
literature
$ 20,000 is invested at a rate of 5% compounded quarterly. identify the compound interest function ta model the situation. then find the balance after