Loops/For with a specified step: Difference between revisions
Content added Content deleted
m (Semi-automated edit: Deleted "Bash" (redundant with "UNIX Shell")) |
|||
Line 68: | Line 68: | ||
} |
} |
||
ExitApp</lang> |
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}}== |
=={{header|BASIC}}== |