CBSE Class 12 Computer Science
Question 33 of 103
Working with Functions — Question 9
Back to all questions 9
Question Which of the following is not correct in context of scope of variables ?
- Global keyword is used to change value of a global variable in a local scope.
- Local keyword is used to change value of a local variable in a global scope.
- Global variables can be accessed without using the global keyword in a local scope.
- Local variables cannot be used outside its scope.
Local keyword is used to change value of a local variable in a global scope.
Reason — If you need to modify a local variable in global scope, you do so by passing it as an argument to a function and/or returning a modified value from the function.