Answer the following questions true (T) or false (F)

1. A variable declared within a function block is said to be local to the function.

2. Consider two blocks, one within another. If an identifier is declared as a variable in the inmost of these two blocks, one can access this variable from the outer block.

1. True
Explanation: Such a variable is said to be local to the function or to have the function as its scope, and is also known as a local variable if the scope is clear from the context.
2. False
Explanation: The scope of a local variable extends from the definition to the end of the block in which the variable is defined. This excludes the outer block.

Computer Science & Information Technology

You might also like to view...

When opening a second window of the current workbook :2 will appear after the title

Indicate whether the statement is true or false

Computer Science & Information Technology

macOS is a UNIX-based operating system.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology