Ask Question
21 August, 10:44

The scope of a variable declared within a for () loop is:

a) Only known within the for () loop

b) Global across all functions in the file containing the code

c) Local to the function containing the for () loop

d) It depends on the variable type

+3
Answers (1)
  1. 21 August, 14:29
    0
    a

    Explanation:

    The scope of a variable declared within the for () loop is only known within the for loop.

    The variable declared within the for () loop is accessible inside the loop itself and it goes out of scope once it comes out of the loop.

    for (int i=1; i<=10; i++) / / variable i is declared inside the loop

    {

    / / variable i is accessible inside this block only

    }

    / / variable i goes out of scope
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “The scope of a variable declared within a for () loop is: a) Only known within the for () loop b) Global across all functions in the file ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers