Declaration of variable inside loop

if a variable ‘i’ is declared inside a loop then everytime the loop is executed the same variable will be declared again and again. Isn’t that inefficient?

If the variable is declared outside the loop and it’s value is changed inside the loop would that make the code efficient in any significant way?

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.

@Piyush Sharma you haven’t answered my query in any way or atleast I can’t see the answer you have provided.

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.

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.