Doubt in first solved example ( sum of digits of n)

how can we possibly know that the number the user entered while running the program be a float . shouldn’t we after doing the arithmetic operation N=N by 10 convert the resultant n to integer and then move forward

We have to define the datatype of our number before taking its input. For example, if we write int n and input the value 10.7, the value stored in n will be 10 only as the code implicitly converts it to int.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.