Someone mentioned looking at the tags and then looking for syntax for that but that was shot down because this is aimed at new users.
A possible better solution would be to look for language names in the body of the question, then apply the same strategy. If I mention "Javascript", "Java" or "C#" then chances are that is what the question is about, and code in the question is likely to be in that language.