/************************************************************************ ex00.cpp ************************************************************************/ #include <iostream> using namespace std; int factoral(const int end) { int result = 1; for (int i = end; i > 1; i--) result = result * i; return result; } float factoral(const float end) { float result = 1; for (int i = end; i > 1; i--) result = result * i; return result; } void main() { for (int i = 0; i < 20; i++) cout << factoral(i) << endl; cout.precision(0); cout.setf(ios::fixed); cout << endl; for (float f = 0.0; f < 20.0; f += 1.0) cout << factoral(f) << endl; }