Department of Computer Science | Institute of Theoretical Computer Science | CADMO

Theory of Combinatorial Algorithms

Prof. Emo Welzl and Prof. Bernd Gärtner

// Prog: fak-1.cpp // compute the n! #include int main () { std::cout << "Factorial of n =? "; int n; std::cin >> n; // computation unsigned int fak = 1; for (unsigned int i = 2; i <= n; ++i) fak *= i; // output std::cout << "Factorial of " << n << " is " << fak << ".\n"; return 0; }