Identify the compiler
Total snippet length 8; test program 83 (C)

Distinguish JavaScript and C from C++, Java, and C#

a;


Distinguish JavaScript from C

0


Distinguish C++ from C# and Java

#


Distinguish C# and Java

[:a]


C code to determine the language

#define C(x)compile(#x)?
main(){puts(C(a;)C(#)C([:a])"J":"C#":"C+":C(0)"C":"JS");}


Snippets tested with

C: gcc 4.7.2 with -std=c99
C++: g++ 4.7.2 with -std=c++11
Java: javac 1.7.0_09
JavaScript: JavaScript-C 1.8.5
C#: Mono C# compiler version 2.10.8.0