-9

The code was like this:

    for (int  i =0;i<[word length];i++)

I'd like to change it to:

 for (int  i =[word length]  ; i>0  ;i--)

but it doesn't work.

So can you help me,please

Eric Aya
  • 69,473
  • 35
  • 181
  • 253

2 Answers2

2
 for (int  i =[word length]-1  ; i>=0  ;i--)
norders
  • 1,160
  • 9
  • 13
-2

And also put the length in a variable before the loop.

Palm
  • 38
  • 4
  • Ok Cool, just thinking on minor optimizations, like don´t re read the length on every turn in the loop – Palm Sep 27 '16 at 11:52