Hello world/Newline omission: Difference between revisions
m
→{{header|Binary Lambda Calculus}}
m (→{{header|XSLT}}: prevent faulty syntax coloring for XSLT) |
|||
(36 intermediate revisions by 21 users not shown) | |||
Line 16:
=={{header|11l}}==
<
=={{header|68000 Assembly}}==
Line 22:
Code is called as a subroutine, taking <code>A0</code> as its argument (e.g. <code>LEA myString,A0 JSR PrintString</code>). The hardware-specific <code>PrintChar</code> routine is left unimplemented.
<
;input: A0 = source address
;outputs to screen.
Line 39:
myString:
DC.B "Goodbye, World!",0
EVEN</
=={{header|ACL2}}==
<
=={{header|Action!}}==
<
Print("Goodbye, World!")
RETURN</
{{out}}
[https://gitlab.com/amarok8bit/action-rosetta-code/-/raw/master/images/Newline_omission.png Screenshot from Atari 8-bit computer]
Line 56:
=={{header|Ada}}==
This example will implicitly include a final, implementation defined, terminator (usually a linefeed) if the output is a file (RM A.10.7-8) such as <code>stdout</code> on UNIX systems.
<
with Ada.Text_IO;
Line 63:
Ada.Text_IO.Put("Goodbye, World!");
end Goodbye_World;
</syntaxhighlight>
Using <code>Ada.Text_IO.Text_Streams</code> instead allows us to control the termination.
<
with Ada.Text_IO;
with Ada.Text_IO.Text_Streams;
Line 74:
String'Write(Ada.Text_IO.Text_Streams.Stream(stdout), "Goodbye World");
end Goodbye_World;
</syntaxhighlight>
=={{header|Agena}}==
<
=={{header|ALGOL 68}}==
This works with Algol68 Genie 2.8.2 and above. Earlier versions appended a gratuitous newline on unflushed output when the program terminated.
<
print ("Goodbye, World!")
END</
=={{header|Arturo}}==
<
{{out}}
Line 93:
=={{header|ATS}}==
<
=={{header|AutoHotkey}}==
<
FileAppend, Goodbye`, World!, CONOUT$ ; No newline outputted
MsgBox</
=={{header|AutoIt}}==
<syntaxhighlight lang="autoit">
ConsoleWrite("Goodbye, World!")
</syntaxhighlight>
=={{header|AWK}}==
<syntaxhighlight lang="awk">
BEGIN { printf("Goodbye, World!") }
</syntaxhighlight>
=={{header|Axe}}==
<
=={{header|B}}==
{{works with|The Amsterdam Compiler Kit - B|V6.1pre1}}
<
{
putstr("Goodbye, World!");
return(0);
}</
=={{header|BASIC}}==
<
20 PRINT "Goodbye, World!";</
==={{header|BaCon}}===
BaCon supports BASIC PRINT ending with trailing semicolon to prevent a newline and also supports a FORMAT clause that uses ''printf'' specifications and special character escapes (with no \n, there is no newline).
<
PRINT "Goodbye, World!" FORMAT "%s"</
==={{header|Applesoft BASIC}}===
<
==={{header|Chipmunk Basic}}===
{{works with|Chipmunk Basic|3.6.4}}
<syntaxhighlight lang="qbasic">print "Goodbye, World!"; '' the trailing semi-colon suppresses the new line</syntaxhighlight>
==={{header|Commodore BASIC}}===
<
20 print "Goodbye, World!";
30 rem * If we end this program here, we will not see the effect because
Line 140 ⟶ 144:
50 rem * So, we just print additional message...
60 print "(End of the world)"
70 end</
{{out}}
<pre>Goodbye, World!(End of the world)
ready.</pre>
==={{header|BASIC256}}===
Output all on a single line.
<
print " ";
print "World!";</
==={{header|GW-BASIC}}===
{{works with|BASICA}}
<syntaxhighlight lang="qbasic">10 PRINT "Goodbye, World!"; '' the trailing semi-colon suppresses the new line</syntaxhighlight>
==={{header|IS-BASIC}}===
<
==={{header|Minimal BASIC}}===
<syntaxhighlight lang="qbasic">10 PRINT "Goodbye, World!"; : REM the trailing semi-colon suppresses the new line
20 END</syntaxhighlight>
==={{header|MSX Basic}}===
<syntaxhighlight lang="qbasic">10 PRINT "Goodbye, World!"; : REM the trailing semi-colon suppresses the new line</syntaxhighlight>
==={{header|QBasic}}===
Line 162 ⟶ 175:
{{works with|Yabasic}}
A trailing semicolon prevents a newline
<
END</
==={{header|Quite BASIC}}===
<syntaxhighlight lang="qbasic">10 PRINT "Goodbye, World!"; : REM the trailing semi-colon suppresses the new line</syntaxhighlight>
==={{header|True BASIC}}===
Line 170 ⟶ 186:
{{works with|Yabasic}}
A trailing semicolon prevents a newline
<
END</
==={{header|XBasic}}===
<syntaxhighlight lang="qbasic">PROGRAM "helloworld"
VERSION "0.0000"
DECLARE FUNCTION Entry ()
FUNCTION Entry ()
PRINT "Goodbye, World!";
END FUNCTION
END PROGRAM</syntaxhighlight>
==={{header|Yabasic}}===
Line 178 ⟶ 205:
{{works with|True BASIC}}
A trailing semicolon prevents a newline
<
end</
=={{header|Batch File}}==
'''Under normal circumstances, when delayed expansion is disabled'''<br/>
The quoted form guarantees there are no hidden trailing spaces after World!
<
<nul set/p=Goodbye, World!</
'''If delayed expansion is enabled, then the ! must be escaped'''<br/>
Escape once if quoted form, twice if unquoted.
<
<nul set/p"=Goodbye, World^!"
<nul set/p=Goodbye, World^^^!</
=={{header|BBC BASIC}}==
<
PRINT "Goodbye World!";
Line 201 ⟶ 228:
FOR i% = 1 TO LEN(GW$)
VDU ASCMID$(GW$, i%)
NEXT</
=={{header|
<
=={{header|beeswax}}==
<syntaxhighlight lang
beeswax prints everything without appending a newline character. beeswax has an instruction to explicitely print a newline character: <code>N</code>.
Line 214 ⟶ 241:
In Befunge, a newline has to be explicitly output when required, so you can just not include one if it's not wanted.
<
=={{header|Binary Lambda Calculus}}==
Starting a program with any of the 16 ASCII characters from space to slash will copy the remainder to stdout, so for example
<pre>*Goodbye, World!</pre>
=={{header|Blade}}==
<syntaxhighlight lang="blade">print('Goodbye, World!')</syntaxhighlight>
=={{header|bootBASIC}}==
"Goodbye, w" and "orld!" are printed on different lines because not enough characters are allowed per line to complete this task in one line, even for the most code golfed version.
<
20 print "orld!";</
=={{header|Bracmat}}==
<
=={{header|Brainf***}}==
One option was to copy the code from the regular Hello World version and omit the last period, but one of the nicer things about the language is that no matter how simple your program is, if it's more than a few characters long, it's probably unique. So here's yet another version of Goodbye, World in Brainf***.
<
+.>>+..<.--.++>>+.<<+.>>>-.>++.[<]++++[>++++<-]>.>>.+++.------.<-.[>]<+.[-]
[G oo d b y e , W o r l d !]</
=={{header|C}}==
In C, we do not get a newline unless we embed one:
<
#include <stdlib.h>
Line 239 ⟶ 275:
(void) printf("Goodbye, World!"); /* No automatic newline */
return EXIT_SUCCESS;
}</
However ISO C leaves it up to implementations to define whether or not the last line of a text stream requires a new-line. This means that the C can be targetted to environments where this task is impossible to implement, at least with a direct text stream manipulation like this.
=={{header|C sharp|C#}}==
<
class Program
Line 256 ⟶ 292:
Console.Write("Goodbye, World!");
}
}</
=={{header|C++}}==
<
int main() {
std::cout << "Goodbye, World!";
return 0;
}</
=={{header|Clipper}}==
<
=={{header|Clojure}}==
<
=={{header|COBOL}}==
<
PROGRAM-ID. GOODBYE-WORLD.
PROCEDURE DIVISION.
DISPLAY 'Goodbye, World!' WITH NO ADVANCING.
STOP RUN.
END PROGRAM GOODBYE-WORLD.</syntaxhighlight>
=={{header|CoffeeScript}}==
Node JS:
<
=={{header|Common Lisp}}==
<
=={{header|Creative Basic}}==
<syntaxhighlight lang="creative basic">
'In a window
Line 337 ⟶ 370:
'Since this a Cbasic console program.
END
</syntaxhighlight>
=={{header|D}}==
{{works with|D|2.0}}
<
void main() {
write("Goodbye, World!");
}</
=={{header|Dart}}==
<syntaxhighlight lang="dart">import 'dart:io';
void main() {
stdout.write("Goodbye, World!");
}</syntaxhighlight>
=={{header|Dc}}==
<syntaxhighlight lang
<syntaxhighlight lang
=={{header|Delphi}}==
<
{$APPTYPE CONSOLE}
Line 358 ⟶ 398:
begin
Write('Goodbye, World!');
end.</
=={{header|dt}}==
<syntaxhighlight lang="dt">"Goodbye, World!" p</syntaxhighlight>
=={{header|DWScript}}==
<syntaxhighlight lang
=={{header|Dyalect}}==
<
=={{header|Dylan.NET}}==
Line 374 ⟶ 417:
{{works with|.NET|4.5}}
One Line version:
<
Goodbye World Program:
<syntaxhighlight lang="dylan.net">
//compile using the new dylan.NET v, 11.5.1.2 or later
//use mono to run the compiler
Line 393 ⟶ 436:
end class
</syntaxhighlight>
=={{header|Déjà Vu}}==
<
=={{header|EasyLang}}==
<syntaxhighlight>
# write omits newline
write "Goodbye, World!"
</syntaxhighlight>
=={{header|EchoLisp}}==
<
(begin
(write "GoodBye, World")
(write "Next on same line"))
</syntaxhighlight>
=={{header|Elena}}==
ELENA 4.x:
<
{
//print will not append a newline
console.write("Goodbye, World!")
}</
=={{header|Elixir}}==
<
IO.write "Goodbye, World!"
</syntaxhighlight>
=={{header|Emacs Lisp}}==
<
{{out}}
Goodbye, World!
=={{header|EMal}}==
<syntaxhighlight lang="emal">write("Goodbye, World!")</syntaxhighlight>
=={{header|Erlang}}==
In erlang a newline must be specified in the format string.
<
=={{header|ERRE}}==
<syntaxhighlight lang="erre">
.......
PRINT("Goodbye, World!";)
.......
</syntaxhighlight>
=={{header|Euphoria}}==
<
puts(1,"Goodbye, world!")</
=={{header|F Sharp|F#}}==
<
// A program that will run in the interpreter (fsi.exe)
printf "Goodbye, World!";;
Line 450 ⟶ 503:
printf "Goodbye, World!"
0
</syntaxhighlight>
=={{header|Factor}}==
<
"Goodbye, World!" write</
=={{header|Falcon}}==
With the print() function:
<
Or via "fast print":
<
=={{header|Fantom}}==
<syntaxhighlight lang="java">
class Main {
Void main() {
// Print with newline
echo("Hello, World!")
// Or
Env.cur.out.printLine("Hello, World!")
// Print without a newline
Env.cur.out.print("Goodbye, world!")
// Also can get a reference to the standard output stream
out := Env.cur.out
out.print("Goodbye, world!")
out.flush() // and flush buffer if needed
// or method chain
out.print("Goodbye, world!").flush()
// Also we can an implement a user-defined method
print("Hello, world! I'm back!");
}
// User-defined 'print' method
private Void print(Str s) {
Env.cur.out.print(s)
}
}
</syntaxhighlight>
=={{header|FOCAL}}==
FOCAL does not insert a newline unless we specifically request one.
<
=={{header|Forth}}==
<
." Goodbye, World!"</
=={{header|Fortran}}==
<
write (*,'(a)',advance='no') 'Goodbye, World!'
end program bye</
The "advance" facility was introduced with F90, as was the ability to specify format instructions (the <code>'(A)'</code> part) without a separate FORMAT statement. Earlier, there was a common extension:
<
1 FORMAT (A,$)
END</
In this, the FORMAT instruction is to accept alphabetic text (the A) from the WRITE statement, followed by the special $ item (of no mnemonic form) which signified that there was not to be any new line action at the end of the output. This sort of thing is useful when writing a prompt to the screen so that the input of the response appears on the same screen line. The text could also have been incorporated into the FORMAT statement, which would be useful if there were many WRITE statements scattered about that were to send forth the same text.
Line 496 ⟶ 573:
=={{header|FreeBASIC}}==
<
Print "Goodbye, World!";
Sleep</
=={{header|Frink}}==
<
=={{header|FutureBasic}}==
FB has several ways to suppress line feeds and/or carriage returns. A few are demonstrated here.
<syntaxhighlight lang="futurebasic">
include "NSLog.incl"
print
// A semicolon will suppress a line feed in a print statement.
print "a, ";
print "b, ";
print "c"
print : print
// When logging, a \b (escaped b) appended to a string will suppress a line feed.
NSLog( @"d, \b" )
NSLog( @"e, \b" )
NSLog( @"f" )
long i
CFMutableStringRef mutStr
mutStr = fn MutableStringWithCapacity(0)
// Feeds and returns can be easily omitted using a mutable string
for i = 1 to 99
MutableStringAppendFormat( mutStr, @"%3ld, ", i )
if ( i mod 10 == 0 ) then MutableStringAppendString( mutStr, @"\n" )
if ( i == 99 ) then MutableStringAppendFormat( mutStr, @"%3ld", i + 1 )
next
print mutStr
HandleEvents
</syntaxhighlight>
{{output}}
[[File:FB Supressed Line Feed.png]]
=={{header|Gambas}}==
'''[https://gambas-playground.proko.eu/?gist=09c8c3464c556325f089f9e4c326eaca Click this link to run this code]'''
<
Print "Goodbye, "; 'The semicolon stops the newline being added
Print "World!"
End</
Output:
<pre>
Line 518 ⟶ 632:
=={{header|gecho}}==
<
=={{header|Genie}}==
<
/*
Hello, with no newline, in Genie
Line 528 ⟶ 642:
init
stdout.printf("%s", "Goodbye, World!")</
{{out}}
Line 536 ⟶ 650:
=={{header|GML}}==
<
=={{header|Go}}==
<
import "fmt"
func main() { fmt.Print("Goodbye, World!") }</
=={{header|Groovy}}==
<
=={{header|GUISS}}==
In Graphical User Interface Support Script, we specify a newline, if we want one. The following will not produce a newline:
<
=={{header|Harbour}}==
<
or
QQout( "Goodbye, world" )
</syntaxhighlight>
=={{header|Haskell}}==
<
=={{header|HolyC}}==
<
=={{header|Io}}==
<syntaxhighlight lang="io">
write("Goodbye, World!")
</syntaxhighlight>
=={{header|Huginn}}==
<
exec huginn --no-argv -E "${0}" "${@}"
#! huginn
Line 579 ⟶ 693:
print( "Goodbye, World!" );
return ( 0 );
}</
=={{header|Icon}} and {{header|Unicon}}==
Native output in Icon and Unicon is performed via the ''write'' and ''writes'' procedures. The ''write'' procedure terminates each line with both a return and newline (for consistency across platforms). The ''writes'' procedure omits this. Additionally, the programming library has a series of ''printf'' procedures as well.
<
writes("Goodbye, World!")
end</
=={{header|IWBASIC}}==
<syntaxhighlight lang="iwbasic">
'In a window
Line 635 ⟶ 749:
'Since this an IWBASIC console program.
END
</syntaxhighlight>
=={{header|J}}==
With ''jconsole'', <code>stdout</code> can be used.
<syntaxhighlight lang="j"> stdout
1!:2&4</syntaxhighlight>
<code>1!:2&4</code> returns its input unmodified. To avoid implicit output (which would repeat the output), when used interactively:
<syntaxhighlight lang="j"> put=: 0 0 $ 1!:2&4
put 'Goodbye, World!'
Goodbye, World!</syntaxhighlight>
However, J also works in graphical environments, which might not be connected to standard output.
'''Solution''':<code>prompt</code> from the misc package.
'''Example''':<
prompt 'Goodbye, World!'
Goodbye, World!</
'''Notes''':
The specific session manager being used changes the context and therefore answer to this task.
With that said, <code>prompt</code> handles the most common cases (using binary output for jconsole, so no newline is appended; adjusting the REPL prompt in the desktop apps to to elide the newline which is normally included by default, etc).
For truly automated processes, you'd almost always want this kind of functionality (omitting the newline when printing) in a file- or stream-oriented application.
So, if a J programmer were asked to solve this task, the right approach would be to ask why that is needed, and then craft a solution appropriate to that situation.
=={{header|Jack}}==
<
function void main () {
do Output.printString("Goodbye, World!");und
return;
}
}</
=={{header|Jakt}}==
<syntaxhighlight lang="jakt">
fn main() {
print("Goodbye, World!")
}
</syntaxhighlight>
=={{header|Janet}}==
<
=={{header|Java}}==
<
{
public static void main(String[] args)
Line 674 ⟶ 800:
System.out.print("Goodbye, World!");
}
}</
=={{header|JavaScript}}==
Node JS:
<
=={{header|Joy}}==
<syntaxhighlight lang="joy">"Goodbye, World!" putchars.</syntaxhighlight>
=={{header|jq}}==
The "-j" command-line option suppresses the newline that would otherwise be printed, e.g. if "$" is the command-line prompt:
<
Goodbye, World!$ </
The trailing "$" is the command-line prompt.
Similarly:
<
Goodbye, World!$ </
=={{header|Jsish}}==
<
Evaluated from the command line as:
Line 700 ⟶ 829:
=={{header|Julia}}==
Julia provides a <code>println</code> function which appends a newline, and a <code>print</code> function which doesn't:
<
=={{header|Kotlin}}==
{{trans|Java}}
<
=={{header|Lang}}==
<syntaxhighlight lang="lang">fn.print(Goodbye, World!)</syntaxhighlight>
=={{header|Lasso}}==
Lasso provides a <code>stdoutnl</code> method that prints a trailing newline, and a <code>stdout</code> method that does not:
<
=={{header|LFE}}==
<
(io:format "Goodbye, World")
</syntaxhighlight>
=={{header|Liberty BASIC}}==
A trailing semicolon prevents a newline
<
</syntaxhighlight>
=={{header|LIL}}==
<syntaxhighlight lang
=={{header|Limbo}}==
<
include "sys.m"; sys: Sys;
Line 737 ⟶ 869:
sys = load Sys Sys->PATH;
sys->print("Goodbye, World!"); # No automatic newline.
}</
=={{header|LLVM}}==
<
; LLVM does not provide a way to print values, so the alternative would be
; to just load the string into memory, and that would be boring.
Line 753 ⟶ 885:
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @"OUTPUT_STR", i32 0, i32 0))
ret i32 0
}</
=={{header|Logtalk}}==
No action is necessary to avoid an unwanted newline.
<
:- object(error_message).
Line 765 ⟶ 897:
:- end_object.
</syntaxhighlight>
=={{header|Lua}}==
<
=={{header|M2000 Interpreter}}==
<syntaxhighlight lang="m2000 interpreter">
Form 80, 45
// set no special format, 8 character column, at 0,0 position, row (top left)
Print $("", 8),@(0,0),
// semi colon
Module Test1 {
Print "Goodbye, "; 'The semicolon stops the newline being added
Print "World!"
}
// comma
Module Test2 {
Print 1,
Print 2,
Print 3,
Print // now we change line
For i=4 to 30 : Print i,: Next
// lines changed according the use of columns
}
Test1
Test2
// we can mix ; and ,
Print "aaa ";1, "bbb ";2, "ccc ";3
</syntaxhighlight>
=={{header|m4}}==
Line 774 ⟶ 933:
(Quoted) text is issued verbatim, "dnl" suppresses all input until and including the next newline. Simply creating an input without a trailing newline would of course accomplish the same task.
<syntaxhighlight lang
=={{header|MANOOL}}==
<
=={{header|Maple}}==
<syntaxhighlight lang="maple">
printf( "Goodbye, World!" );
</syntaxhighlight>
=={{header|Mathematica}} / {{header|Wolfram Language}}==
<
Another one that works in scripts:
<
=={{header|MATLAB}} / {{header|Octave}}==
<
=={{header|Microsoft Small Basic}}==
<syntaxhighlight lang="smallbasic">TextWindow.Write("Goodbye, World!")</syntaxhighlight>
{{out}}
<pre>Goodbye, World!Press any key to continue...</pre>
=={{header|min}}==
<
=={{header|mIRC Scripting Language}}==
<syntaxhighlight lang
=={{header|ML/I}}==
===Simple solution===
In ML/I, if there isn't a newline in the input, there won't be one in the output; so a simple solution is this (although it's hard to see that there isn't a newline).
<syntaxhighlight lang
===More sophisticated solution===
To make it clearer, we can define an ML/I ''skip'' to delete itself and an immediately following newline.
<
Goodbye, World!""</
=={{header|Modula-2}}==
<
FROM Terminal IMPORT WriteString,ReadChar;
Line 814 ⟶ 978:
WriteString("Goodbye, World!");
ReadChar
END HelloWorld.</
=={{header|N/t/roff}}==
Line 822 ⟶ 986:
Because /.ROFF/ is a document formatting language, most text input is expected to be text input which will get output on paper, so there is usually no need to run a special procedure or routine to output text.
<
Goodbye, World!
</syntaxhighlight>
=={{header|Nanoquery}}==
<
=={{header|Neko}}==
The Neko builtin $print does not add a newline.
<syntaxhighlight lang="actionscript">/**
hellonnl.neko
Tectonics:
Line 845 ⟶ 1,009:
*/
$print("Goodbye, World!");</
{{out}}
Line 854 ⟶ 1,018:
=={{header|Nemerle}}==
<
module Hello
Line 864 ⟶ 1,028:
Write("Goodbye, ");
Write("world!");
}</
=={{header|NetRexx}}==
<
options replace format comments java crossref symbols binary
say 'Goodbye, World!\-'
</syntaxhighlight>
=={{header|NewLISP}}==
<
=={{header|Nim}}==
<
=={{header|NS-HUBASIC}}==
<
=={{header|Oberon-2}}==
<
MODULE HelloWorld;
IMPORT Out;
Line 889 ⟶ 1,053:
Out.String("Goodbye, world!")
END HelloWorld.
</syntaxhighlight>
=={{header|Objeck}}==
<
bundle Default {
class SayGoodbye {
Line 901 ⟶ 1,065:
}
}
</syntaxhighlight>
=={{header|OCaml}}==
Line 907 ⟶ 1,071:
In OCaml, the function <code>[http://caml.inria.fr/pub/docs/manual-ocaml/libref/Pervasives.html#VALprint_endline print_endline]</code> prints a string followed by a newline character on the standard output and flush the standard output. And the function <code>[http://caml.inria.fr/pub/docs/manual-ocaml/libref/Pervasives.html#VALprint_string print_string]</code> just prints a string with nothing additional.
<
=={{header|Oforth}}==
<
=={{header|Ol}}==
To omit the trailing newline use `display` instead of `print`.
<
(display "Goodbye, World!")
</syntaxhighlight>
=={{header|OOC}}==
To omit the trailing newline use print instead of println:
<
"Goodbye, World!" print()
}</
=={{header|Oxygene}}==
{{incorrect|Oxygene|output isn't consistent with the task's requirements: wording, capitalization.}}
<
namespace HelloWorld;
Line 948 ⟶ 1,112:
end.
</syntaxhighlight>
<pre>
>HelloWorld.exe
Line 955 ⟶ 1,119:
=={{header|Panoramic}}==
<syntaxhighlight lang="panoramic">
rem insert a trailing semicolon.
print "Goodbye, World!";
print " Nice having known you."</
=={{header|PARI/GP}}==
<
=={{header|Pascal}}==
<
begin
write('Goodbye, World!');
end.</
Output:
<pre>% ./NewLineOmission
Line 975 ⟶ 1,139:
=={{header|PASM}}==
<
end</
=={{header|Perl}}==
<
=={{header|Phix}}==
Phix does not add '\n' automatically, except for the '?' (debugging) shorthand; if you want one you must remember to add it explicitly.
<!--<
<span style="color: #7060A8;">puts</span><span style="color: #0000FF;">(</span><span style="color: #000000;">1</span><span style="color: #0000FF;">,</span><span style="color: #008000;">"Goodbye, World!"</span><span style="color: #0000FF;">)</span>
<!--</
=={{header|PHL}}==
Printf doesn't add newline automatically.
<
extern printf;
Line 996 ⟶ 1,160:
printf("Goodbye, World!");
return 0;
]</
=={{header|PHP}}==
<
=={{header|Picat}}==
<syntaxhighlight lang="picat">print("Goodbye, World!")</syntaxhighlight>
=={{header|PicoLisp}}==
<
=={{header|Pict}}==
<
=={{header|Pike}}==
<
=={{header|Pixilang}}==
<
=={{header|PL/I}}==
<syntaxhighlight lang="pl/i">
put ('Goodbye, World!');
</syntaxhighlight>
=={{header|Plain English}}==
<
Start up.
Write "Goodbye, world!" on the console without advancing.
Wait for the escape key.
Shut down.</
=={{header|PowerShell}}==
<
Write-Host -NoNewLine "World!"</
{{Out}}
<pre>Goodbye, World!PS C:\></pre>
=={{header|Processing}}==
<
print("Goodbye, World!"); /* No automatic newline */
</syntaxhighlight>
=={{header|PureBasic}}==
<
Print("Goodbye, World!")
Input() ;wait for enter key to be pressed</
=={{header|Python}}==
<
sys.stdout.write("Goodbye, World!")</
{{works with|Python|3.x}}
<
=={{header|Quackery}}==
Line 1,053 ⟶ 1,220:
Quackery does not automatically insert a new line.
<
=={{header|R}}==
<
=={{header|Ra}}==
<syntaxhighlight lang="ra">
class HelloWorld
**Prints "Goodbye, World!" without a new line**
Line 1,066 ⟶ 1,233:
print "Goodbye, World!" without new line
</syntaxhighlight>
=={{header|Racket}}==
<
(display "Goodbye, World!")</
=={{header|Raku}}==
(formerly Perl 6)
A newline is not added automatically to print or printf
<syntaxhighlight lang="raku"
printf "%s", "Goodbye, World!";</
=={{header|RASEL}}==
<syntaxhighlight lang="text">"!dlroW ,olleH">:?@,Gj</
=={{header|REBOL}}==
<
=={{header|Red}}==
<
=={{header|Retro}}==
<syntaxhighlight lang
=={{header|REXX}}==
Line 1,094 ⟶ 1,261:
<br>blank line so as to not leave the state of the terminal with malformed "text lines" (which can be followed by other text
<br>(lines) from a calling program(s), or the operating system (shell) which is usually some sort of a "prompt" text string.
<
call charout ,'Goodbye, World!'</
=={{header|Ring}}==
<
=={{header|Ruby}}==
<
=={{header|Run BASIC}}==
<
=={{header|Rust}}==
<
print!("Goodbye, World!");
}</
=={{header|Salmon}}==
<
=={{header|Scala}}==
Line 1,119 ⟶ 1,286:
===Ad hoc REPL solution===
Ad hoc solution as [http://en.wikipedia.org/wiki/Read%E2%80%93eval%E2%80%93print_loop REPL] script. Type this in a REPL session:
<
=={{header|Scheme}}==
<
=={{header|Scilab}}==
Scilab can emulate C <code>printf</code> which, by default, does not return the carriage.
<
=={{header|Seed7}}==
<
const proc: main is func
begin
write("Goodbye, World!");
end func;</
=={{header|SETL}}==
<
=={{header|Sidef}}==
<
or:
<
=={{header|Smalltalk}}==
<
Transcript show: 'Goodbye, World!'.
</syntaxhighlight>
=={{header|Standard ML}}==
<
=={{header|Swift}}==
{{works with|Swift|2.x+}}
<
{{works with|Swift|1.x}}
<
=={{header|Tcl}}==
<
=={{header|Transact-SQL}}==
{{incorrect|Transact-SQL|output isn't consistent with the task's requirements: wrong word.}}
As an output statement, PRINT always adds a new line
<syntaxhighlight lang
or:
As a result set
<syntaxhighlight lang
=={{header|TUSCRIPT}}==
<
$$ MODE TUSCRIPT
PRINT "Goodbye, World!"
</syntaxhighlight>
Output:
<pre>
Line 1,181 ⟶ 1,348:
=={{header|TXR}}==
Possible using access to standard output stream via TXR Lisp:
<
Goodbye, world!$</
=={{header|UNIX Shell}}==
Line 1,189 ⟶ 1,356:
{{works with|Bourne Shell}}
<
printf %s "-hyphens and % signs" # Use %s with arbitrary strings.</
Unfortunately, older systems where you have to rely on vanilla Bourne shell may not have a ''printf'' command, either. It's possible that there is no command available to complete the task, but only on very old systems. For the rest, one of these two should work:
<
or
<
The ''print'' command, from the [[Korn Shell]], would work well, but most shells have no ''print'' command. (With [[pdksh]], ''print'' is slightly faster than ''printf'' because ''print'' runs a built-in command, but ''printf'' forks an external command. With [[ksh93]] and [[zsh]], ''print'' and ''printf'' are both built-in commands.)
Line 1,204 ⟶ 1,371:
{{works with|zsh}}
<
print -nr -- "-hyphens and \backslashes"</
==={{header|C Shell}}===
C Shell does support <code>echo -n</code> and omits the newline.
<
echo -n "-hyphens and \backslashes"</
=={{header|Ursa}}==
Ursa doesn't output a newline to an I/O device by default, so simply omitting an endl object at the end of the output stream is all that's needed.
<
=={{header|
<syntaxhighlight lang="Uxntal">|00 @System &vector $2 &expansion $2 &wst $1 &rst $1 &metadata $2 &r $2 &g $2 &b $2 &debug $1 &state $1
|10 @Console &vector $2 &read $1 &pad $4 &type $1 &write $1 &error $1
|0100
;message
&loop
LDAk .Console/write DEO
INC2 LDAk ?&loop
POP2
#80 .System/state DEO
BRK
@message "Goodbye, 20 "World! 00</syntaxhighlight>
=={{header|Vale}}==
{{works with|Vale|0.2.0}}
<syntaxhighlight lang="vale">
import stdlib.*;
exported func main() {
print("Goodbye, World!");
}
</syntaxhighlight>
=={{header|Verbexx}}==
<syntaxhighlight lang="verbexx">@STDOUT "Goodbye, World!";</syntaxhighlight>
=={{header|Verilog}}==
<
initial
begin
Line 1,228 ⟶ 1,419:
$finish ;
end
endmodule</
=={{header|Vim Script}}==
<
=={{header|Visual Basic .NET}}==
<
Sub Main()
Line 1,241 ⟶ 1,432:
End Sub
End Module</
=={{header|V (Vlang)}}==
<syntaxhighlight lang="v (vlang)">fn main() { print("Goodbye, World!") }</syntaxhighlight>
=={{header|Web 68}}==
Line 1,247 ⟶ 1,441:
Use the command 'tang -V hello.w68', then 'chmod +x hello.a68', then './hello.a68'
<
=={{header|Wren}}==
<
=={{header|XLISP}}==
Either
<
or
<
=={{header|XPath}}==
<syntaxhighlight lang
=={{header|XPL0}}==
<
Text(0, "Goodbye, World!")</
=={{header|XSLT}}==
<
=={{header|zkl}}==
<
Console.write("Goodbye, World!");</
=={{header|Zig}}==
<syntaxhighlight lang="zig">const std = @import("std");
pub fn main() !void {
}</syntaxhighlight>
=={{header|ZX Spectrum Basic}}==
<
20 PRINT "Goodbye, World!";</
{{omit from|Craft Basic|No keyword to output without newline}}
{{omit from|SQL PL|It does not provide a command to not add a new line. There is not CALL DBMS_OUTPUT.CURRENT_LINE, only CALL DBMS_OUTPUT.NEW_LINE}}
|