I see nothing "illegal" about your code. However, you should never use an infinite loop, see while (true), and you're not using the return value of the even function. Also, in your even function, this line if(x=0) should be if (x == 0)
It's illegal because the curly parentheses ('{' and '}') don't match up in _tmain correctly. You only have one }, you should have two as there are two opening parentheses.
It's giving this error because it thinks that you've defined the function 'even' inside _tmain, due to mismatching parentheses.
Function definitions shouldn't be written within each other in C++.