Small knowledge, big challenge! This article is participating in the creation activity of “Essential Tips for Programmers”.


The origin of Hello World

Hello, World was originally created by Brian Kernighan. In 1978, Brian Kernighan wrote a programming book called the C Programming Language, which was widely circulated among programmers. The Hello World program he first cites in this book comes from a 1973 B programming tutorial he wrote:


main (){
extrn a,b,c;
putchar (a); putchar (b); putchar (c); putchar ('! *n');
}
a 'hell';
b 'o, w';
c 'orld';
Copy the code


Unfortunately, by the time Forbes India interviewed him, some of his own memories of the saga were a bit hazy. When asked why he chose “Hello, World! “He replied,” ALL I remember is, I think I saw a cartoon about an egg and a chicken, and in that cartoon, the chicken said ‘Hello World’.”

Original text: blog.hackerrank.com/the-history…


Hello World implemented in multiple languages

Hello World was almost the first program that programmers learned in any language


The C language

#include "stdio.h"

int main(a){
    printf("Hello World");
    return 0;
}
Copy the code

My first Hello World program was written in C. Remember what language you wrote your first Hello World program in?


Java

public class HelloWorld {  
    
  public static void main(String[] args){   
  	System.out.println("Hello,World"); }}Copy the code


Html

<! DOCTYPEhtml>  
<html>
<title>My first web page</title>  
<body>  
    <p>Hello World</p>  
</body>  
</html>
Copy the code

You can just copy the code to Notepad and save it, then change the file’s suffix to HTML and open it in a browser to see what it looks like


JavaScript

<script>
	console.log('Hello World'); # browser console prints alert("Hello World"); </script>Copy the code


Open a page in any browser and press F12 to display the browser’s built-in debugging tool. You can write JavaScript on the Console screen


Note: on some computers, the F12 key has other functions, which may conflict with the shortcut key of the browser. Most computers will have a FN key. We can open the debugging tool of the browser by the FN + F12 key


Python

print "Hello World"	 # python 2.x

print("Hello World") # python 3.x
Copy the code

Isn’t it easy to write python


Sql

mysql> select 'Hello World';
+-------------+
| Hello World |
+-------------+
| Hello World |
+-------------+
1 row in set (0.03 sec)
Copy the code

You can also do this with Sql, you can also try the select arithmetic operation


Here we recommend a W3Cschool for various languages to develop the IDE online, so that when debugging other languages code is much more convenient

Online development builds the IDE


The tail language

✍ Code writes the world and makes life more interesting. ❤ ️

✍ thousands of rivers and mountains always love, ✍ go again. ❤ ️

✍ code word is not easy, but also hope you heroes support. ❤ ️