How to solve this?

Problem in expression

i<=2n

maybe you meen

i <= 2 * n

?

This expression is error.

i<=2n

Please do not use such large screenshots for illustrating an error. It is hard to read, especially in browser on a smaller window size.

From what I can see, in your code you have a compiler error on the expression “2n”.
That is not legal syntax. I guess you want to express “2 times n”, which you write down as “2 * n” in most programming languages.