second max of three no

this program gave correct anwer only for 2 testcase after it donot give desireable output.please debug it

int main()
int x,y,z,max,max1;
return 0;

Very first, please try putting your code in proper indented blocks. It becomes tough for people to first indent it and then read. You may try posting ideone link as well.
Secondly, talking about your code, lets say you give the input as 4 5 2, as per your code, answer will be 2. Because you are judging the second maximum only on the basis of z.
Hope it clears… :slight_smile: