Doubt on the first example solved

how could we now in the start whether the number obtained is float or interger