Why am I facing this error? If i run th same code in VS Code, it executes perfectly

This is the code.

You are creating an infinite loop. T will be never equal to 0 because you are not decrementing it.

1 Like

Just use a for lop