View Problem

Perform an action a fixed number of times with a counter

Display the string "10 .. 9 .. 8 .. 7 .. 6 .. 5 .. 4 .. 3 .. 2 .. 1 .. Liftoff!"
DiskEdit
perl
for (my $i = 10; $i > 0; $i--) {
print "$i .. ";
}
print "Liftoff!";
DiskEdit
perl
print "$_ .. " for reverse 1..10;
print "Liftoff!";
ExpandDiskEdit
cpp C++/CLI .NET 2.0
for(int i = 10; i != 0; --i) Console::Write("{0} .. ", i);
Console::WriteLine("Liftoff!");
DiskEdit
csharp
for (int i = 10; i > 0; i--)
{
Console.Write("{0} .. ", i);
}

Console.WriteLine("Liftoff!");

Submit a new solution for perl, cpp, or csharp
There are 18 other solutions in additional languages (clojure, erlang, fantom, fsharp ...)