Difference between revisions of "Salutare lume!"
From linux360
m (→Pascal: Code fix (ANSI C-ism :"> )) |
m (Added syntax highlighting) |
||
Line 7: | Line 7: | ||
==Bash== | ==Bash== | ||
− | + | <code><sh/>#!/bin/bash | |
− | + | ||
− | + | echo "Hello, world!" | |
− | + | exit 0</code> | |
==BASIC== | ==BASIC== | ||
− | + | <code><basic/>10 PRINT "Hello, world!" | |
− | + | 20 STOP</code> | |
==ANSI C== | ==ANSI C== | ||
− | + | <code><c/>#include <stdio.h> | |
− | + | ||
− | + | int main(void) { | |
− | + | printf("Hello, world!\n"); | |
− | + | ||
− | + | return 0; | |
− | + | };</code> | |
==Pascal== | ==Pascal== | ||
− | + | <code><pascal/>program HelloWorld; | |
− | + | ||
− | + | begin | |
− | + | writeln('Hello, world!'); | |
− | + | end.</code> | |
==PHP== | ==PHP== | ||
− | + | <code><html/><html> | |
− | + | <body> | |
− | + | <?php | |
− | + | echo "Hello, world!"; | |
− | + | ?> | |
− | + | </body> | |
− | + | </html></code> | |
[[Category:Collection]] | [[Category:Collection]] | ||
[[Category:Programming]] | [[Category:Programming]] |
Revision as of 13:57, 17 January 2006
Introducere
Am creeat acest articol din dorinta de a arata lumii diversitatea limbilor existente in informatica.
Ceea ce urmeaza sunt moduri de a spune Salutare, lume! in diverse limbaje de programare. Puteti adauga exemple noi cu conditia sa fie corecte programatic, sa fie tratate in varianta standard a limbajului folosit si sa ramana sortate in ordine alfabetica.
Urmeaza exemplele:
Bash
<sh/>#!/bin/bash
echo "Hello, world!" exit 0
BASIC
<basic/>10 PRINT "Hello, world!"
20 STOP
ANSI C
<c/>#include <stdio.h>
int main(void) {
printf("Hello, world!\n");
return 0;
};
Pascal
<pascal/>program HelloWorld;
begin
writeln('Hello, world!');
end.
PHP
<html/><html>
<body>
<?php
echo "Hello, world!";
?>
</body>
</html>