Re: Hello world! Examples of different languages
Sed
s/.*/Hello, world!/
q
Re: Hello world! Examples of different languages
Sed
s/.*/Hello, world!/
q
Re: Hello world! Examples of different languages
![]()
copy ekumunng
[fd@localhost ~]$ cat helloEK.c
main()
{
printf("Hello World
");
}
compile:
[fd@localhost ~]$ gcc -o helloEK helloEK.c
check:
[fd@localhost ~]$ ./helloEK
Hello World
convert to assembly:
[fd@localhost ~]$ gcc -S helloEK.c
[fd@localhost ~]$ cat helloEK.s
.file "helloEK.c"
.section .rodata
.LC0:
.string "Hello World"
.text
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc
pushl %ebp
.cfi_def_cfa_offset 8
.cfi_offset 5, -8
movl %esp, %ebp
.cfi_def_cfa_register 5
andl $-16, %esp
subl $16, %esp
movl $.LC0, (%esp)
call puts
leave
.cfi_restore 5
.cfi_def_cfa 4, 4
ret
.cfi_endproc
.LFE0:
.size main, .-main
.ident "GCC: (GNU) 4.8.2 20131212 (Red Hat 4.8.2-7)"
.section .note.GNU-stack,"",@progbits
[fd@localhost ~]$
assembly :halo:
Re: Hello world! Examples of different languages
Sed
s/.*/Hello, world!/
q
Naturally, it follows, awk:
awk "BEGIN {print \"Hello World\"}"
Re: Hello world! Examples of different languages
^Yep.
VB.NET
Module Module1
Sub Main()
Console.WriteLine("Hello, world!")
End Sub
End Module
'non-console example:
Class Form1
Public Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load()
MsgBox("Hello, world!")
End Sub
End Class
Re: Hello world! Examples of different languages
I'll try C++ . Been 12 yrs since I did that, but well, I'll give it a try.
Void main() { cout <<"Hello World"; } PS: correct me if I'm wrong.
Void should be lower case, so that wouldn't compile.
Re: Hello world! Examples of different languages
^ I knew there was some mistake ![]()
Re: Hello world! Examples of different languages
No worries though…I remember spending hours trying to compile my pascal code. Now that was a bummer.
Re: Hello world! Examples of different languages
HTML
I don't mean to pick on you, but for it to show up on the page you would have to put it in the body tag:
Re: Hello world! Examples of different languages
Perl 5
use v5.10;
say 'Hello, world!';
Re: Hello world! Examples of different languages
I’m a bit rusty I suppose ![]()
Thanks for the correction ![]()
Re: Hello world! Examples of different languages
I have had my blunders while compiling ages ago ![]()
Re: Hello world! Examples of different languages
delphi
program HelloWorld;
begin
Writeln('Hello, world!');
end.