- Scala
- Scala
- Ada
- C
- Caml
- Clojure
- Cobol
- C++
- C#
- C#
- C#
- D
- D
- Dart
- Dart
- Elixir
- Erlang
- Fortran
- Go
- Go
- Go
- Groovy
- Haskell
- JS
- JS
- JS
- JS
- Java
- Java
- Java
- Java
- Java
- Java
- Java
- Kotlin
- Kotlin
- Kotlin
- Lisp
- Lua
- Lua
- Lua
- Lua
- Obj-C
- PHP
- PHP
- Pascal
- Perl
- Perl
- Perl
- Prolog
- Python
- Python
- Python
- Python
- Python
- Python
- Ruby
- Ruby
- Ruby
- Rust
- Rust
- Scheme
- Scheme
- Scheme
- Smalltalk
- VB
- Ada
- C
- Caml
- Clojure
- Cobol
- C++
- C#
- C#
- C#
- D
- D
- Dart
- Dart
- Elixir
- Erlang
- Fortran
- Go
- Go
- Go
- Groovy
- Haskell
- JS
- JS
- JS
- JS
- Java
- Java
- Java
- Java
- Java
- Java
- Java
- Kotlin
- Kotlin
- Kotlin
- Lisp
- Lua
- Lua
- Lua
- Lua
- Obj-C
- PHP
- PHP
- Pascal
- Perl
- Perl
- Perl
- Prolog
- Python
- Python
- Python
- Python
- Python
- Python
- Ruby
- Ruby
- Ruby
- Rust
- Rust
- Scheme
- Scheme
- Scheme
- Smalltalk
- VB
Console.WriteLine( string.Concat(Enumerable.Repeat("Hello\n", 10)) );
Console.WriteLine(string.Join(Environment.NewLine, Enumerable.Repeat("Hello", 10)));
generate(() -> "Hello%n")
.limit(10)
.forEach(out::printf);
range(0, 10).forEach(x -> out.println("Hello"));
for ($i = 0; $i < 10; $i++) {
echo 'Hello' . PHP_EOL;
}
Note the necessary newline (PHP_EOL), not to print every time on the same line
print "Hello\n" for 1 .. 10;
Note the necessary newline (\n), not to print every time on the same line
say "Hello" for 1 .. 10;
Recent (5.10 and later) versions of Perl also provide
say function, which automatically adds the newline.
say function, which automatically adds the newline.
(define (hellos i)
(if (> i 0)
(begin
(display "Hello")
(newline)
(hellos (- i 1)))))
(hellos 10)
programming-idioms.org