How to write hello world different languages syntax


The learning curve - hello world

As a developer, you all must have worked on various programming languages and must have started with a simple "hello world" example. Though the message remains the same, every language has a different syntax (set of commands) to print it (with few exceptions where the command is the same for more than 1 language).

Listed below is the syntax of some common computer programming languages (chronologically), do leave a comment if we missed any language

Programming Language Command Syntax
ABAP WRITE WRITE 'hello world'.
ADA Put_Line Put_Line("hello world");
APPLESCRIPT display dialog display dialog "hello world"
ASP.NET Response.Write Response.Write("hello world");
BASIC PRINT PRINT "hello world"
BATCH @echo @echo hello world
C printf printf("hello world");
C++ std:cout << std:cout << "hello world";
C# Console.WriteLine Console.WriteLine("hello world");
COBOL DISPLAY DISPLAY "hello world".
D writeln writeln("hello world");
F# printfn printfn "hello world"
FORTRAN write write(*,*) 'hello world'
HTML hello world
JAVA System.out.println System.out.println("hello world");
JAVASCRIPT alert alert('hello world')
LOGO print print [hello world]
MATLAB disp disp('hello world')
OBJECTIVE-C NSLog NSLog("hello world");
PASCAL WriteLn WriteLn('hello world');
PERL print print "hello world";
PHP echo <?php echo 'hello world'; ?>
PL/SQL DBMS_OUTPUT.PUT_LINE DBMS_OUTPUT.PUT_LINE('hello world');
POWERSHELL 'hello world'
PYTHON print print "hello world"
RUBY puts puts "hello world"
SQL select select 'hello world'
SWIFT println println("hello world")
VISUAL BASIC MsgBox MsgBox "hello world"
VISUAL BASIC .NET Console.WriteLine Console.WriteLine("hello world")
VISUAL FOXPRO ? ? "hello world"
XSLT <xsl:text> <xsl:text>hello world


Copyright © Code2care 2024 | Privacy Policy | About Us | Contact Us | Sitemap