Chapter 5: Problem 12
Is it permissible for a local variable in one function to have the same name as a local variable in a different function?
Short Answer
Expert verified
Explain your answer.
Answer: Yes, local variables can have the same name across different functions. This is because the scope of a local variable is limited to the function it is declared in. The variables in different functions have no effect on each other even if they have the same name. They exist within their respective functions, and their values are independent of one another.