Question

    What is the scope of a variable declared inside a block of code (e.g., within curly braces)?

    A It can be accessed from anywhere within the same file. Correct Answer Incorrect Answer
    B It can only be accessed within the same block of code. Correct Answer Incorrect Answer
    C It can be accessed from any function within the same file. Correct Answer Incorrect Answer
    D It can only be accessed from functions declared after the block. Correct Answer Incorrect Answer

    Solution

    It can only be accessed within the same block of code.

    Practice Next

    Relevant for Exams: