21.) In this c++ program. Create a flowchart and algorithm. Source Code: #include using namespace std; int main() { int n; long double factorial = 1.0; cout > n; if (n


21.) In this c++ program. Create a flowchart and algorithm.


Source Code:


#include
using namespace std;


int main() {
    int n;
    long double factorial = 1.0;


    cout < "enter="" a="" positive="" integer:="">
    cin >> n;


    if (n <>
        cout < "error!="" factorial="" of="" a="" negative="" number="" doesn't="">
    else {
        for(int i = 1; i <= n;="" ++i)="">
            factorial *= i;
        }
        cout < "factorial="" of="" "="">< n="">< " = " << factorial;
    }


    return 0;
}



"="">    }


    return 0;
}



>
Jun 10, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here