You can get the same output with for and while loops:
While:
$i = 0; while ($i <= 10){ print $i.\"\\n\"; $i++; };
Depends on the language and most likely its compiler, but they should be equivalent in most languages.