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;} "=""> " = " << factorial; }
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;}
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here