+ 1
Hello. Explain me the 'for' loop .
I don't clearly understand when I want to find the final value of my variable using that loop.
5 Antworten
+ 1
for(initial_value;condition_test;what_to_do_with_that_value_every_loop){loop to execute }
+ 1
thanks, wagner
+ 1
for(x=0;x<4;x++){
document.write(x);}
is basically equal to,
var x=0;
while(x<4){
x++;}
0
example, after running:
for(X=0;X<5;X++){
print(X);
}
the last value that was given to this for loop as X was 5, but 5<5 evaluate as false, so the code did not executed, the last printed value would be 4
0
for(initialize ; Condition; increment)
{
// your code
}
for ( int i=0; i<10; i++) {
statement(s);
}