divide the whole string by 2. i is used to track index in current number . j is used to track index for next iteration .
int j = 0 ; for ( int i = 0 ; i < len_str ; i ++ ) { num = num * 10 + ( int ) str [ i ] - ( int ) '0' ;