If current character is space then word has ended . Check if it is even length word or not . If yes then compare length with maximum length found so far .
if ( str [ i ] == ' ▁ ' ) { if ( currlen % 2 == 0 ) { if ( maxlen < currlen ) { maxlen = currlen ; st = i - currlen ; } }