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.
- Python
- Python
- Ada
- C
- Caml
- Clojure
- Cobol
- C++
- C#
- D
- D
- Dart
- Elixir
- Elixir
- Erlang
- Fortran
- Go
- Groovy
- Haskell
- JS
- JS
- JS
- Java
- Java
- Kotlin
- Lisp
- Lisp
- Lisp
- Lua
- Lua
- Obj-C
- PHP
- PHP
- PHP
- Pascal
- Perl
- Perl
- Prolog
- Prolog
- Ruby
- Rust
- Scala
- Scheme
- Smalltalk
- VB
print("Hello World")
print('Hello World')
print_endline "Hello World!"
(println "Hello World")
DISPLAY "Hello World!".
pragma(msg, "Hello World");
Compile-time hello world
print("Hello World");
"Hello World" |> IO.puts
io:format("~s~n", ["Hello, world!"])
print *, 'Hello, world!'
in modern Fortran (2003+) I would consider using the print statement more idiomatic than the write statement
println 'Hello World'
putStrLn "Hello world!"
console.log('Hello World')
"... The console object provides access to the debugging console".
There is also `info`, `warn`, `error`, `debug`, etc.
There is also `info`, `warn`, `error`, `debug`, etc.
System.out.println("Hello World");
println("Hello world!")
(format T "Hello World")
(print "Hello World")
sbcl common lisp dialect
(princ "Hello, world!")
io.write("Hello world")
<?='Hello World'?>
Using the short echo syntax, a non-deprecated short tag expression.
echo "Hello World" . PHP_EOL;
Use PHP_EOL instead of \n
<?php echo 'Hello World'; ?>
Characters outside of execution blocks are immediately echoed.
WriteLn('Hello, world!');
print "Hello, world!\n";
The print statement doesn't put an automatic newline: it must be asked for explicitly.
format("Hello world~n")
write('Hello, world!\n')
println("Hello, World!")
(display "Hello World")
Transcript cr; show: 'Hello World!'
The Transcript is a standard-output-like object in the Smalltalk environment.
FYI; In classic Smalltalk, message cr alone does not output line breaks (it requires followed by an endEntry message i.e. Transcirpt cr ; entEntry.), so there was a convention to output a line break firstly then output the text by using show: method in which includes the endEntry process. Hence the cr message is sending firstly in the idiom.
FYI; In classic Smalltalk, message cr alone does not output line breaks (it requires followed by an endEntry message i.e. Transcirpt cr ; entEntry.), so there was a convention to output a line break firstly then output the text by using show: method in which includes the endEntry process. Hence the cr message is sending firstly in the idiom.