"Hello World" for new-programer

作者: peakrock | 来源:发表于2016-07-21 13:07 被阅读0次

"Hello World" Program

C program example:

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

C++ program example:

#include <iostream>
using namespace std;
int main(){
    cout << "Hello World" << endl;
    return 0;
}

Java program example:

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

Php program example:

<?php
echo "Hello World\n";
?>

Javascript program example:

console.log("Hello World");

Shell program example:

!/bin/bash
echo "Hello World\n"

Compare six program language.

language study grade code length
c S B
c++ S A
java B S
php C C
javascript C B
shell A D

Thanks!

测试

相关文章

网友评论

    本文标题:"Hello World" for new-programer

    本文链接:https://www.haomeiwen.com/subject/asgvjttx.html