What is the error? One Test case is showing error
Two numbers X and Y denoting the rest of the numbers of the Pythagorean triplet in increasing order.
in n%2==0 loop
System.out.print(var-1+" ");
System.out.print(var+1);
if this solves your doubt please mark it as resolved 
