Plz correct the code and mark correction in my code

you have use m instead of mid
and in m garbage is present so that’s why i gives wrong ans

modified code