Login
|
Signup
langref.org
-
php
and
clojure
add..
all
cpp
csharp
erlang
fantom
fsharp
go
groovy
haskell
java
ocaml
perl
python
ruby
scala
Home
All
Solved
Unsolved
Strings
Numbers
Regex
Lists
Maps
Structure
Files
Dates
OOP
Networking
XML
Algorithms
Misc
Parallel
View Problem
Structure
Loops
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!"
php
for($i = 10; $i > 0; $i--) {
echo $i." .. ";
}
echo "Liftoff!";
<?php
for($i = 10; $i > 0; $i--) {
echo $i." .. ";
}
echo "Liftoff!";
?>
clojure
(dotimes [i 10]
(print (str (- 10 i) " .. ")))
(println "Liftoff!")
(dotimes [i 10]
(print (str (- 10 i) " .. ")))
(println "Liftoff!")
Submit a new solution for
php
or
clojure
There are 20 other solutions in
additional
languages (
cpp
,
csharp
,
erlang
,
fantom
...)