Why assign a value to the variable largest

Why shall i assign a value to the variable largest what if my input are larger than the number than it will print the value i assigned to largest

@dharamrajroy_275ef8688612039e,
u can change the value according to the given constraint say u have value btw 0 to 1000 want to find maximum in these u can initialize maximum initially to -1

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.

but what if i dont know between what my constrains will be what if i gave a person to test my code and he can enter any value

@dharamrajroy_275ef8688612039e,
u r given constraint everywhere
each problem domain has a constraint

what if i am not solving a problem but gave my friend to test the code?

@dharamrajroy_275ef8688612039e,
no u dont give friend to test a code right?
u give it to online judge which is not a ad hoc way of judgement

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.