Capgemini Interview Question

1. What is the difference between the local variable and global variable in C? 2. What is the difference between call by value and call by reference in C?

Interview Answer

Anonymous

Nov 3, 2022

1. I clearly mentioned the main difference that the variable is declared inside the block for local variable and for global variable the variable is declared outside, I also spoke about scope, life and storage 2. call by value means when a value is passed in the function the original value is not modified, but in call by reference the value passed by the function the original value is not modified, i also spoke on arguments and memory location.