#include #include using namespace std; void factorial(); int main() { double f = 123.45; factorial(); cout << "The f in main is " << f << ".\n"; return EXIT_SUCCESS; } void factorial() { int f = 1; for (int i = 1; i <= 4; ++i) { f *= i; //or f = f * i; } //The i has already been destroyed by the time we arrive here. cout << "The factorial of 4 is " << f << ".\n"; } //The f in factorial gets destroyed when we arrive here.