Ask Question
23 May, 23:55

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

+1
Answers (1)
  1. 24 May, 03:14
    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?
Find 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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers