Tuesday, September 25, 2012

Code Syntax Highlighting Test

This is a test of the code syntax highlighter created by Alex Gorbatchev.

Various Hello World Programs

C++ code

#include <iostream>

int main(void)
{
    using namespace std;
    cout << "hello world" << endl;
}

Java code

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

Matlab code

% print numbers 1 through 10
for i = 1:10
    printf('%d ', i);
end
printf('\n');

More Advanced Features

Different starting lines

if(a % 3 == 0)
{
    cout << "a is divisible by 0" << endl;
}

No comments :

Post a Comment