Skip to content
  • Home
  • Code
  • iOS & Swift
  • Combine
  • RxSwift
  • SwiftUI
  • Flutter & Dart
  • Tutorials
  • Art
  • Blog
Fx Studio
  • Home
  • Code
  • iOS & Swift
  • Combine
  • RxSwift
  • SwiftUI
  • Flutter & Dart
  • Tutorials
  • Art
  • Blog
Written by chuotfx on September 17, 2019

“Hello world” trong các ngôn ngữ lập trình

Blog

“Hello world” hay chương trình “Hello world” là chương trình máy tính in ra dòng chữ “Hello world” trên thiết bị hiển thị. Vì đây là chương trình đơn giản nhất ở mọi ngôn ngữ lập trình, cho nên nó thường được dùng trong việc mô phỏng cho người mới bắt đầu về cú pháp lập trình cơ bản trong ngôn ngữ lập trình, hay để xác định ngôn ngữ hoặc hệ thống nào đó hoạt động tốt. Vậy …

Bạn đã viết được bao nhiêu chương trình “Hello world” trong các ngôn ngữ lập trình rồi?

main( ) {
        printf("hello, world\n");
}

Trước tiên thì mình đi qua lịch sử của nó một chút.

    • 1972, Brian Kernighan trong cuốn sách “Tutorial Introduction to the Language B”.
    • 1974, Brian Kernighan và Dennis Ritchie trong cuốn sách “The C Programming Language”
    • Được phổ biến về sau khi trở thành tiêu chuẩn
      • Cho cú pháp đầu tiên cần phải học của mọi ngôn ngữ lập trình.
      • Cho việc kiểm tra trình biên dịch và môi trường phát triển hoạt động đúng.

Bây giờ thì mình sẽ liệt kê “Hello world” trong vài ngôn ngữ.

1. JavaScript

console.log("Hello World!");

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

3. Python
# Python 2
print "Hello World!"

# Python 3
print("Hello World!")

4. Ruby
puts 'Hello World!'

5. PHP
echo 'Hello World';

6. C++
#include <iostream>

int main()
{
  std::cout << "Hello World!";
}

7. CSS
<style type="text/css">
h1 {
    color: DeepSkyBlue;
}
</style>

<h1>Hello World!</h1>

8. C#
using System;

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

9. C
#include<stdio.h>

main()
{
    printf("Hello World!");
}

10. Go
package main

import "fmt"

func main() {
	fmt.Println("Hello World!")
}

11. Shell
#!/bin/bash

echo "Hello World!"

12. Objective C
#import <Foundation/Foundation.h>

int main (int argc, const char * argv[])
{
    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
    NSLog (@"Hello World!");
    [pool drain];
    return 0;
}

13. Scala
object HelloWorld {
  def main(args: Array[String]): Unit = {
    println("Hello World!")
  }
}

14. Swift
print("Hello World!")

15. TypeScript
class HelloWorld {
    constructor(public greeting: string) { }
    sayHello() {
        return "<h1>" + this.greeting + "</h1>";
    }
};

var greeter = new HelloWorld("Hello World!");
console.log(greeter.greet());

 

….

Nếu bạn muốn xem hết thì có thể tham khảo tại đây.

FacebookTweetPinYummlyLinkedInPrintEmailShares0

Related Posts:

  • Các thành phần trong Combine
    Các thành phần trong Combine
  • RxSwift vs. UIKit – Tương tác giữa các ViewController
    RxSwift vs. UIKit – Tương tác giữa các ViewController
  • Các Websites dành cho các bạn bắt đầu học lập trình
    Các Websites dành cho các bạn bắt đầu học lập trình
  • RxSwift - Hello world!
    RxSwift - Hello world!
Tags: blog
Written by chuotfx

Hãy ngồi xuống, uống miếng bánh và ăn miếng trà. Chúng ta cùng nhau đàm đạo về đời, về code nhóe!

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Donate – Buy me a coffee!

Recent Posts

  • Map type – Dart Tour
  • Set type – Dart Tour
  • List type – Dart Tour
  • Null safety – Dart Tour
  • Classes & Objects – Dart Tour
  • Quick trong 10 phút
  • Nimble trong 10 phút
  • Functions – Dart Tour
  • Control Flow – Dart Tour
  • API Testing (UnitTest) with OHHTTPStubs

Fan page

Fx Studio

Archives

  • August 2022 (4)
  • July 2022 (7)
  • June 2022 (8)
  • May 2022 (5)
  • April 2022 (1)
  • March 2022 (3)
  • February 2022 (5)
  • January 2022 (4)
  • December 2021 (6)
  • November 2021 (8)
  • October 2021 (8)
  • September 2021 (8)
  • August 2021 (8)
  • July 2021 (9)
  • June 2021 (8)
  • May 2021 (7)
  • April 2021 (11)
  • March 2021 (12)
  • February 2021 (3)
  • January 2021 (3)
  • December 2020 (3)
  • November 2020 (9)
  • October 2020 (7)
  • September 2020 (17)
  • August 2020 (1)
  • July 2020 (3)
  • June 2020 (1)
  • May 2020 (2)
  • April 2020 (3)
  • March 2020 (20)
  • February 2020 (5)
  • January 2020 (2)
  • December 2019 (12)
  • November 2019 (12)
  • October 2019 (19)
  • September 2019 (17)
  • August 2019 (10)

Tags

Actor Advanced Swift api AppDistribution Asynchronous autolayout basic ios tutorial blog callback ci/cd closure collectionview combine concurrency CoreData Core Location crashlytics darkmode dart dart basic dart tour Declarative decoding delegate deploy fabric fastlane firebase flavor flutter GCD iOS mapview MVVM optional protocol rxswift Swift Swift 5.5 SwiftUI SwiftUI Notes tableview testing TravisCI unittest

You may also like:

  • Closure trong 10 phút
    Closure trong 10 phút
  • [Vui] Hội chứng quá để tâm đến lỗi ngữ pháp
    [Vui] Hội chứng quá để tâm đến lỗi ngữ pháp
  • Basic Swift trong 10 phút
    Basic Swift trong 10 phút
  • iOS & Swift - Tuyển tập các câu hỏi cho phỏng vấn
    iOS & Swift - Tuyển tập các câu hỏi cho phỏng vấn
  • Các Websites dành cho các bạn bắt đầu học lập trình
    Các Websites dành cho các bạn bắt đầu học lập trình

About me

Education, Mini Game, Digital Art & Life of coders
Contacts:
contacts@fxstudio.dev

Fx Studio

  • Home
  • About me
  • Contact us
  • Mail
  • Privacy Policy
  • Donate
  • Sitemap

Categories

  • Art (1)
  • Blog (20)
  • Code (4)
  • Combine (22)
  • Flutter & Dart (16)
  • iOS & Swift (83)
  • RxSwift (37)
  • SwiftUI (75)
  • Tutorials (69)

Newsletter

Stay up to date with our latest news and posts.
Loading

Copyright © 2022 Fx Studio - All rights reserved.

Share this ArticleLike this article? Email it to a friend!

Email sent!