Loops/For with a specified step: Difference between revisions

Add Bash example
No edit summary
(Add Bash example)
Line 68:
}
ExitApp</lang>
 
=={{header|Bash}}==
<lang bash>for ((i=0;i<10;i+=2)); do
echo "$i"
done</lang>
Do the same loop with steps of 2 3 and 4
<lang bash>for step in 2 3 4; do
for ((i=0;i<10;i+=step)); do
echo "step ${step}: $i"
done
done</lang>
 
=={{header|BASIC}}==
Anonymous user