Logo

Programming-Idioms

Print the numbers 5, 4, ..., 0 (included), one line per number.
Implementation
Pascal

Implementation edit is for fixing errors and enhancing with metadata. Please do not replace the code below with a different implementation.

Instead of changing the code of the snippet, consider creating another Pascal implementation.

Be concise.

Be useful.

All contributions dictatorially edited by webmasters to match personal tastes.

Please do not paste any copyright violating material.

Please try to avoid dependencies to third-party libraries and frameworks.

Other implementations
import "fmt"
for i := 5; i >= 0; i-- {
	fmt.Println(i)
}
for i=5, 0, -1 do
	print(i)
end
for (int i = 5; i >= 0; i--) {
  print(i);
}
5.downto(0){|n| puts n }
for i in range(5, -1, -1):
    print(i)
do i=5,0,-1
  print *,i
end do
(let loop ([x 5])
  (when (>= x 0)
    (display x)
    (newline)
    (loop (sub1 x))))
for (int i = 5; i >= 0; i--) {
	printf("%d\n", i);
}
for (let i = 5; i >= 0; i--) {
  console.log(i)
}
Imports System
For i = 5 To 0 Step -1
    Console.WriteLine(i)
Next
using System;
for (int i = 5; i >= 0; i--)
{
    Console.WriteLine(i);
}
(0..=5).rev().for_each(|i| println!("{}", i));
5 to: 0 by: -1 do: [:i | Transcript showln: i asString].
print "$_\n" for reverse (0..5);
import Control.Monad (forM_)
forM_ (reverse [0..5]) print
for(int i=5 ; i>=0 ; i--) {
    System.out.println(i);
}
for A in reverse 0 .. 5 loop
   Put_Line (A'Image);
end loop;
(dotimes (i 6) (print (- 5 i)))
for (int i = 5; i >= 0; --i) {
	std::cout << i;
}
foldl  (\res x-> x:res) [] [0..5]
for i in (0..=5).rev() {
    println!("{}", i);
}
$values = range(0, 5);
$valuesReversed = array_reverse($values);
foreach($valuesReversed as $value)
{
    printf("%s\n", $value);
}
(doseq [n (range 5 0 -1)]
  (println n))