3 ms·
Answer to Q3 is incorrect. It should be d: - the function does not handle overflow (say x=1024, n=1024 in most if not all current C compilers) - worse, the fu
by Someone 15y ago
Answer to Q3 is incorrect. It should be d:
- the function does not handle overflow (say x=1024, n=1024 in most if not all current C compilers)
- worse, the function does not handle the case n<0.
The "n<0 => function returns 1" case led me to rule out answers a, b, and c.