Max of a no program not accepting otther cases

in this program always ans is showing value of infinity i m not able to find where is my error