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

List the types of degrees that are available to you after high school.
PLEASE HELP I’m confused and I need help with this .
Compare and contrast coenotyic and septate fungi
sinking of rock layers
Bill Hudson was a real craftsman when it came to being a machinist. Bill had learned almost all that he knew from Hugo Huffman, his first and only employer. Bil
how many quarter-pound (1/4) packets of plant food can a garden shop make out of 8 pounds of the plant food?
Guyssss helpppppppp Romantic writers rejected the logical style of writers from the age of reason and instead focused on individual experiences, thoughts, and e
What do you think of History channels Vikings show? will give brainiest.
Find the midpoint M of the line segment joining the points S = (3, -5) and T = (-7, 7).
Help ya girl out ahhhh 20 points