Taking input in linked list

Why are we creating a function for input when we can take it like this

is there any advantage in taking input the was it is explained in video

there is no additional advantage of making function. sir has done it just to clearly highlight everything

ooh got it…

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.