"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 |
网友评论