Hello World in Different Languages

Assembly:

lobal _start section .text _start: mov rax, 1 ; write( mov rdi, 1 ; STDOUT_FILENO, mov rsi, msg ; "Hello, world!\n", mov rdx, msglen ; sizeof("Hello, world!\n") syscall ; ); mov rax, 60 ; exit( mov rdi, 0 ; EXIT_SUCCESS syscall ; ); section .rodata msg: db "Hello, world!", 10 msglen: equ $ - msg

Cobol

IDENTIFICATION DIVISION. PROGRAM-ID. HELLOWRD. PROCEDURE DIVISION. DISPLAY "HELLO WORLD". STOP RUN.

C

#include <stdio.h> int main() { // printf() displays the string inside quotation printf("Hello World!"); return 0; }

C++

C#

Java

JavaScript:

Python

 

2024 - Programming 3 / Data Structures - Author: Dr. Kevin Roark