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

What ideas arose in the Roman Republic that left a lasting legacy for the development of democratic values in the modern world?
What's the answer for this question?
Explain the rationale for the government providing electricity to the people.
what is 30 perent of 65
There are 12 inches in 1 foot and 5,280 feet in 1 mile. Elena ran 2 ½ miles.
A plant is already 57cm talk and it will grow one centimeter every month the plant height h in centimeters after m months is given by the following function wha
what's the meaning of giant​
The instructions will be given by the principal change it into active voice​
7. Which of the following is true? 1. For a pair of functions to be inverses, their compositions must be equal to 1. 2. In an inverse relation, coordinates of t
Find the point P that partitions the line segment AB given the ratio. A (3, 6) B(4, 3) with the ratio 2:1 (11 over 3,4) (4,11 over 3) (5, 8) (10, 12 over 5)