이 블로그 검색

2020년 11월 3일 화요일

컴퓨터 언어별 hello world!출력과 실행방법

BASIC 

10 PRINT "hello, world!"

20 END

c언어 

#include <stdio.h>

int main()

{

printf("Hello,world!");
}

아두이노

void setup() {

 Serial.begin(9500);

    Serial.println("Hello,World!);

}

void loop(){}

c++

#include <iostream>

int main()

{

std::cout <<"Hello,World!"<<std::endl;

return 0;

}

c#

using System;

namespace Csharpv

{

    class Program

    {

        static void Main(string[] args)

        {

            console.WriteLine("Hello,world!");

       }

    }

}

cobol

**********************************

IDENTIFICATION DIVISION.

PROGRAM-ID.   HELLO.

ENVIRONMENT DIVISION.

DATA DIVISION.

PROCEDURE DIVISION.

MAIN SECTION.

DISPLAY "Hello World!"

STOP RUN.

********************************

D언어

import std.stdio;

void main()

{

    writeln("Hello, world!");

}

FORTRAN

program

    Print *, "Hello,world!"

        End

Go언어

package main

import "fmt"

func main()    {

    fmt.Printf("Hello,world!")

}

HQ9+

H

java

public class Foo {
    public static void

    main(String[] args) {

    System.out.println

    ("Hello, world!");

    }

}

Javascript

document.write("Hello, world!");

or

alert("Hello, world!);

or

consol.log("Hello,world");

Jsp

<%

out.println("hello,world!");

%>

Lua

print("Hello,world!")

object c

#import <Foundation/Foundation.h> int main(int argc, const char * argv[]) { @autoreleasepool { // insert code here... NSLog(@"Hello, World!"); } return 0; }


Pascal

Program Hello;

begin

    writeln("Hello, world!")

end.

Perl

print "Hello, world!\n";

PHP7

<?php

    echo ("Hello, world!");

?>

Python 3

print("Hello, world!")

Assembly Intel x64 architecture

section .data

hello_world    db        "Hello, world!", 0x0a

        section .text

        global _start

_start:

        mov rax, 4

        mov rbx, 1

        mov rcx, hello_world

        mov rdx, 14

        syscall

        mov rax, 1

        mov rbx, 0

        syscall

Ahui


댓글 없음:

댓글 쓰기