Factorial calculator in CPP