Pages

Monday, 19 June 2017

"Hello World!" Example in 12 different languages

A programming language is a formal language that specifies a set of instructions that can be used to produce various kinds of output. Programming languages generally consist of instructions for a computer. Programming languages can be used to create programs that implement specific algorithms.Here is a list of "Hello World!" example in 12 different programming languages.

1. C

#include<stdio.h>
int main()
{
     printf("Hello World!");
     return 0;
}

2.C++

#include<iostream>
using namespace std;
int main(
    cout<<"Hello World!";
    return 0;
}

3.C#

public class Hello
{
   public static void Main()
    {
        System.Console.WriteLine("Hello World!");
     }
}

4.JAVA

public class Hello
{
      public static void main(String[] args)
    {
         System.out.println("Hello World!");
    }
}

5.Python 

print("Hello World!");

6.Perl

#!/usr/bin/perl
use strict;
use warnings;
print "Hello World!";

7. Fortan

      PRINT *, "Hello World!"
      END

8.Ruby

puts "Hello World!"


9.R

print("Hello World!",quote=FALSE)

10.PASCAL

program Hello;
begin
         writeln('Hello World!')
end.

11.D

import std.stdio;
void main(){
       writeln("Hello World!");
}

12.BrainF**k (Esoteric language )

++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++.>++.<<+++++++++++++++.>.+++.------.--------.>+.>.








No comments:

Post a Comment