Line 9 returns a value of zero from your function, explicitly ignoring anything user input in your function. Instead of returning 0 , return the value you wish to pass back to main().
BTW, “any” is a name that will conflict with the Standard Library.
> i want to know why the output is different
You didn't post anything to compare against (different to what?), and you didn't describe what you thought would happen.