How to Write 'Hello World' in 25 Programming Languages

Knowing how to develop a program is a blessings I believe! Because as we all know the world is behind over technology and mainly Artificial Intelligence (AI) which is said to be the fifth generation of computer, so every tech gadgets are working by the written codes. Therefore codes are having great significance in terms of developing technology.


Today we offer some of the basic programming languages and how you can write 'Hello World' in each of these. Hope you enjoy.

1. C

#include
int main(void)
{
puts(“Hello, world!”);
}

2. C++

#include
int main()
{
std::cout << “Hello, world!”;
return 0;
}

3. C#

using System;
class Program
{
public static void Main(string[] args)
{
Console.WriteLine(“Hello, world!”);
}
}

4. Java

import javax.swing.JFrame; //Importing class JFrame
import javax.swing.JLabel; //Importing class JLabel
public class HelloWorld {
public static void main(String[] args) {
JFrame frame = new JFrame(); //Creating frame
frame.setTitle(“Hi!”); //Setting title frame
frame.add(new JLabel(“Hello, world!”));//Adding text to frame
frame.pack(); //Setting size to smallest
frame.setLocationRelativeTo(null); //Centering frame
frame.setVisible(true); //Showing frame
}
}

5. JavaScript

document.write(‘Hello, world!’);

6. HTML

Hello World!

7. Python

print “Hello, world!”

8. Pascal

program HelloWorld;
begin
WriteLn(‘Hello, world!’);
end.

9. Ruby

puts “Hello, world!”

10. Visual Basic .NET

Module Module1
Sub Main()
Console.WriteLine(“Hello, world!”)
End Sub
End Module

11. MatLab

disp (‘Hello, world!’)

12. jQuery

$(“body”).append(“Hello world!”);

13. Bash

echo “Hello World”

14. Perl 5

print “Hello, world!”;

15. Basic

PRINT “Hello, world!”

16. Objective-C

#import
#import
int main(void)
{
NSLog(@”Hello, world!”);
return 0;
}

17. XSLT

Hello World

18. CoffeeScript

console.log ‘Hello, world!’

19. Logo

print [Hello, world!]

20. VBScript

MsgBox “Hello, World!”

21. Clipper

? “Hello World”

22. Delphi

program HelloWorld;
begin
Writeln(‘Hello, world!’);
end.

23. Julia

println(“Hello world!”)

24. Processing

void setup(){
println(“Hello, world!”);
}

25. R

cat(‘Hello, world!’)

26. Swift

println(“Hello, world!”)
Thanks for your time!

No comments:

Powered by Blogger.