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

क्रम मिलाएर लेख। खनिज, उत्पादन, बसोबास, सदुपयोग, जीवन​
help me with this algebra problem
if n(A) = 12, n(b) = 9 and n(AuB) = 16 then find the value of n (A-B)​
Please help me hurry I do not have a lot of time
What is the definition of Disquieting Machetes?
At 6:00 AM, the temperature was 2 degrees Celsius. At 11:00 AM, the temperature was -11 degrees Celsius. By how many degrees Celsius did the temperature change?
Help me please! Am horrible at math.
(x+1)/5 + (x+1)/6 + (x+1)/7 + (x+1)/8 + (x+1)/9 + (x+1)/10 = 0
what is the volume of a substance with a mass of 64.9 g/ and a density of 2.1 g/ml?
Copyright Reserved use a net to derive a formula for the total surface area of a cube,