Writing basic programs: Hello World

Writing "Hello Word!" for the first time

In 1978, Brian Kernighan first wrote "Hello World!" in his book "The C Programming Language"

  • The code in his book reads like this:

main(){
extrn a,b,c;
putchar(a); putchar(b); putchar©; putchar(‘!*n’);
}

a ‘hell’;
b ‘o, w’;
c ‘orld’;

Hello Word in multiple programming languages!

After feeling the charm of programming languages, after my Baidu search and sorting, and comparing the textbook knowledge I have learned with online knowledge, I list the following frequently used programming languages ​​Hello World! Code segment (part of the basic code segment is still displayed according to the code segment of the textbook, so that everyone can learn based on the textbook), this is a tribute to Brian!

Hello World! ``

common programming language

C

C language is the most important programming language in the world.

(It is the main programming language for operating systems, browsers and 3D game engines such as Windows, MacOS, iOS and Android)

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

C++

C++ language performance close to C

(Easier to build large projects, fast and efficient.)

#include <iostream.h>
main()
{
    
    
    cout << "Hello World!" << endl;
    return 0;
}

Java

The Java language is the most popular programming language in the world, um, the most popular.

(Here's the magic: write the code once and run it on any operating system.)

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

Python

The syntax of Python is relatively compact, and the required code is much less than that of Java and C.

(very popular, often used for websites and artificial intelligence (AI) tasks, etc.)

print("Hello World!")

JavaScript

JavaScript is the most common programming language in the world.

(Almost all web browsers use this programming language, which makes JavaScript the standard for WEB interaction.)

console.log("Hello World");

other languages

R

An excellent statistical language.

(After searching and studying online, I learned that this is a popular choice in the scientific community)

cat("Hello world\n")

HTML

"html" is the abbreviation of "Hyper Text Markup Language", that is, "Hyper Text Markup Language", which is an application under the standard general markup language.

(Note: html is not a programming language, it is a markup language, which is composed of some tags and is mainly used to make web pages.)

<HTML>
    <HEAD>
        <TITLE>Hello World!</TITLE>
    </HEAD>
    <BODY>
        Hello World!
    </BODY>
</HTML>

MATLAB

Matlab is an advanced matrix/array language. Users can synchronize the input statement with the execution command in the command window, or write a large and complex application program (M file) first and then run it together.

(It covers control statements, functions, data structures, input and output, and object-oriented programming features.)

disp('Hello World');

expressive

  • Of course, there are Node.js, Swift, Perl, PHP, BASH, BASIC, FORTRAN... many programming languages ​​suitable for computer programming teaching or network backend, or visual programming, and a small Some programming languages ​​are disappearing (homage to that era), these are the cornerstones of the history of computer programming!

Guess you like

Origin blog.csdn.net/weixin_55764157/article/details/126475569