asked 27.3k views
1 vote
Which of the following is the initial statement in the following for loop? (Assume that all variables are properly declared.) int i; for (i = 1; i < 20; i++) cout << "Hello World"

1 Answer

5 votes

Answer:

The answer to the given question is "i=1".

Explanation:

In the given c++ code the we use the for loop. We use this loop when we know exactly how many times it will execute. This loop is also known as entry control loop.

Syntax :

for(initialization; condition ; increment/decrements)

{

C++ statement(s);

}

Example:

for (int i = 1; i < 20; i++)

{

cout<< "Hello";

}

That's why initial statement for the for loop is "i=1".

answered
User Awithrow
by
9.0k points