Knowing how to write Hello, World! in a programming language is the first step to learn how to code. Some of Hello World! codes in languages I know of a bit (no syntax hightlight):
;;; bash
echo Hello, World!
;;; C, Kernighan and Ritchie, The C Programming Language, 2nd edition:
#include <stdio.h>
int main()
{
printf(“Hello, World!\n”);
}
;;; D programming language:
import std.stdio;
void main()
{
writeln(“Hello, world!”);
}
;;; Fortran 90 <:
program hello
write(*,*) ‘Hello, World!’
end program hello
or
program hello
print *, ‘Hello, World!’
end program hello
;;; Haskell:
main = putStrLn “Hello, World!”
;;; JavaScript:
document.write(‘Hello, World!’);
;;; Julia:
println(“Hello, World!”)
;;; Emacs Lisp or ELips:
(message “Hello, World!”)
;;; Racket:
#lang racket
(display “Hello, World!”)
;;; Scheme
(display “Hello, World!”)
;;; OCaml:
print_endline “Hello, World!”
;;; Python2:
print “Hello, World!”
;;; Python3:
print(“Hello, World!”)
;;; Rust:
fn main() {
println!(“Hello, World!”)l
}
;;; Sed:
s/.*/Hello, World!/
q
;;; Tcl:
puts “Hello, World!”
'컴퓨터 > 프로그래밍' 카테고리의 다른 글
프로그래밍 배우기와 연습 (0) | 2016.07.13 |
---|---|
CLing: C++ 인터프리터 (0) | 2016.05.23 |
이현룡 싱가포르 수상 수도쿠 푸는 C++ 코드 (0) | 2015.05.12 |
오바마 대통령은 버블 소트가 비효율적이라는 정도는 안다! (0) | 2015.05.06 |