Using same name of variable twice in a code

sir has used int n in main function and he has again used int n in factorial function. Is this allowed?? the program should show error of reinitialising a variable according to me. (at 30:50)