Minimum of 3 nos

What happen to me, My mins function which I used to find minimum of three numbers is giving strange output.
Please help me.

Code- Strange behaviour

Its silly and frustrating please help me.

1 Like

return(min(min(a,b),c)) here u go

1 Like

Thanks.
But Do you know reason why when passing three parameter is not giving correct result.
condition of inequality inside function seems correct.

You can try min({ a1,a2,a3,… so on}) . This will work fine.

1 Like

Then , why my code is giving undefined behaviour.
What is missing

because if p==q you are returning r independently of the relation between p and r

1 Like

Thanks a lot
you made my day!!!