Logical error for finding the largest number

i have given the logic by mentioning that , if n1 is one number so for n1>=n2 ,0 and if n2>=n1,o and n3 , 0 so after giving the statemnt for zero bcs if itll be lesser than zero so it will be negative automatically , so how can i fix this … and is this logoc wrong ?