Skip to main content

Hello World program in different different languages

C:

#include<stdio.h>

int main(){

    printf("Hello World\n");

    return 0;

}

 

C++:

#include<iostream>

using namespace std;

int main(){

    cout<<"Hello World"<<endl;

    return 0;

}

 

Python:

print("Hello World\n")

 

Node JS:

console.log("Hello World");

 

Java Script:

document.write("Hello World");

 

Objective C:

#import <Foundation/Foundation.h>

int main(int argc, const char* argv[]){

    @autoreleasepool{

        NSLog(@"Hello World");

    }

     0;

}


JAVA:

class HelloWorld{

    public static void main(String[] args){

        System.out.println("Hello World");

    }

}


BASH:

echo "Hello World"



Comments

Popular Posts

Why you should start programming with C?

         You must have listened about C programming from many peoples, yes C is a mid level programming language It contains both language features HLL & LLL so it is called mid level language. So today we will talk about some history & uses of this C programming language.     C was developed at AT & T's Bell Laboratories of USA in 1972. It was designed & written by a man Dennis Ritchie & we also call him father modern programming languages. In the late seventies(70s) began to replace the more familiar languages of that time like PL/I, ALGOL, etc. No one pushed C.       Thus without any advertisements C reputation spread & its pool of users grew. Ritchie seems to have been rather surprised that so many programmers preferred C to older languages like FORTRAN or PL/I, or the newer once PASCAL & APL. But that's what happened. Possibly why C seems so popular is because it was reliable, simple & eas...