222k views
3 votes
You can initialize more than one variable in a for loop by placing a(n) ____ between the separate statements.

a.
equal sign

b.
comma

c.
period

d.
semicolon

1 Answer

4 votes

Answer:

comma

Step-by-step explanation:

The for loop is used to execute the specific statement again and again until the condition is false.

The syntax:

for(initialization;condition;increment/decrement)

{

statement;

}

In the initialization, we an initialize more than one variable by using the 'comma' as separator.

similarly for condition and increment/decrement part as well.

for example:

for(int x = 0,y = 0;x<5,y<5;x++,y++)

{

statement;

}

we can used as many as possible by using comma

User Edward Loveall
by
5.1k points