In the above program the statement while(w[i]!='\0') is clearly telling that the w[i] is not a null character. then it contains some value between alphabetic range. so as has some number above 60 and below 97. so it will take negative index a[-x] and that value is equal to 0 by default and it is always less than 'l.