41.3k views
3 votes
The scope of a variable declared in a for loop's initialization expression always extends beyond the body of the loop

True False

User KLHauser
by
5.5k points

1 Answer

6 votes

Answer:

False

Step-by-step explanation:

for loop is used to run the statement again and again until the condition put inside the for loop is false.

syntax:

for(initialization;condition;increment/decrement)

{

statement;

}

the initialization scope is valid only within the curly braces of the for loop. it is not valid outside the body of the for loop.

because initialization is the part of the for loop.

User Aneuris
by
5.3k points