Sollicitatievraag bij Capgemini

Differentiate between a for loop and a while loop? What are it uses?

Antwoord op sollicitatievraag

Anoniem

20 jun 2012

for loop statement is divided into three sections each one is followed by termination sign(i.e. semicolon) . Syntax:- for(initialization;condition;iteration) { //body of the loop } initialization-In this section we initialize the variable by assigning certain value to it.example - int i=0 condition- it is like that -i=1) { cout <

1