Hello world/Text: Difference between revisions

From Rosetta Code
Content added Content deleted
No edit summary
No edit summary
Line 2:
 
=Text Terminal=
==bash==
 
==[[BASIC]]==
'''Interpreter:''' [[Bourne Again Shell]] (bash)
 
#!/bin/bash
echo "Goodbye World!"
 
 
==BASIC==
 
'''Compiler:''' [[BASICA]]
Line 17 ⟶ 10:
 
 
==[[C]]==
 
'''Compiler Suite:''' [[GCC]] 4.0.1
Line 31 ⟶ 24:
 
 
==[[C++]]==
 
'''Compiler Suite:''' [[GCC]] 4.1.2, [[Visual Studio]] 2005
Line 46 ⟶ 39:
}
 
==[[Lua]]==
 
'''Interpreter:''' [[Lua]] 5.1.1
Line 58 ⟶ 51:
In Lua, parentheses are optional for function calls when there is only one argument and this argument is either a string or a table constructor.
 
==[[Pascal]]==
'''Compiler:''' [[Free Pascal]]
 
Line 66 ⟶ 59:
end.
 
==[[Perl]]==
 
'''Interpreter:''' [[Perl]] 5.8.8
Line 72 ⟶ 65:
#!/usr/bin/perl -w
print "Goodbye, World!\n";</nowiki></pre>
 
==[[UNIX Shell]]==
 
'''Interpreter:''' [[Bourne Again Shell]] (bash)
 
#!/bin/bash
echo "Goodbye World!"
 
=GUI=
==[[Visual Basic .NET]]==
'''Compiler Suite:''' [[Visual Studio]] 2005
Module GoodbyeWorld

Revision as of 21:25, 9 January 2007

In the User Output task, the goal is to display the string "Goodbye, World!"

Text Terminal

BASIC

Compiler: BASICA

10 print "Goodbye World!"


C

Compiler Suite: GCC 4.0.1

#include <stdio.h>

int main(int argc, char **argv)
{
  printf("Goodbye, World!\n");

  return 0;
}


C++

Compiler Suite: GCC 4.1.2, Visual Studio 2005

#include <iostream>

using std::cout;
using std::endl;

int main () {
  cout << "Goodbye, World!" << endl;

  return 0;
}

Lua

Interpreter: Lua 5.1.1

print("Goodbye, World!")

or:

print "Goodbye, World!"

In Lua, parentheses are optional for function calls when there is only one argument and this argument is either a string or a table constructor.

Pascal

Compiler: Free Pascal

program byeworld;
begin
 writeln('Goodbye, World!');
end.

Perl

Interpreter: Perl 5.8.8

#!/usr/bin/perl -w

print "Goodbye, World!\n";</nowiki>

UNIX Shell

Interpreter: Bourne Again Shell (bash)

#!/bin/bash
echo "Goodbye World!"

GUI

Visual Basic .NET

Compiler Suite: Visual Studio 2005

Module GoodbyeWorld
    Sub Main()
        MsgBox("Goodbye, World!")
    End Sub

End Module</nowiki>