kcarson8078 kcarson8078
  • 23-08-2019
  • Computers and Technology
contestada

Which is an example of a valid “for” statement?

a) for(int i = 0 ; i < 5 ; i++)

b) for(string i ; i = 0 ; i++)

c) for(char i = 0 ; i < 8 ; j++)

Respuesta :

Branta Branta
  • 26-08-2019

Answer:

a) for(int i = 0 ; i < 5 ; i++)

Explanation:

a) for(int i = 0 ; i < 5 ; i++) is a valid for statement.

It makes use of an integer variable i which initializes to 0. Then the loop condition (i<5) is evaluated to verify that it is true.

After this loop body is executed. At the end of the body, loop variable is incremented by 1 and next iteration of loop commences. This process continues till loop condition becomes false at which point the loop terminates.

Answer Link

Otras preguntas

Why was cassius' death ironic and the result of his tragic flaw causing a false perception of reality?.
How many grams of protein should i eat a day calculator.
K12 6th math 3.04 Help And check ur answer before u post thx quick
for each inequality,decide whether the solution is represented by x <2.5 or x > 2.4
La celebración Raúl is explaining how he and his family are preparing for his sister's birthday party. Read his description and answer the questions that follow
Pls, help me on this question :(
The group that has elements with the outer energy level filled is called the.
Answer this first question and I will give you brainliest
What is Dans ya famille, vous regardez des feuilletons Américains? In negative form
How does the House of Representatives serve citizens today?