193k views
3 votes
An initialization expression may be omitted from the for loop if no initialization is required.

True False

User Pkofod
by
5.3k points

1 Answer

6 votes

Answer:

True

Step-by-step explanation:

for loop is used to repeat the process again and again until the condition not failed.

syntax:

for(initialize; condition; increment/decrement)

{

Statement

}

But we can omit the initialize or condition or increment/decrement as well

the syntax after omit the initialization,

for( ; condition; increment/decrement)

{

Statement

}

The above for loop is valid, it has no error.

Note: don't remove the semicolon.

You can omit the condition and increment/decrement.

and place the semicolon as it is. If you remove the semicolon, then the compiler show syntax error.

User William Booth
by
4.6k points