If the first digit is 1 , then make it 0 and add 9 at the end of the String .
if ( a [ 0 ] == '1' && String . Compare ( s , s1 ) == 0 ) { int l = s . Length ; a = a . Replace ( a [ 0 ] , '0' ) ; for ( int i = 0 ; i < l ; i ++ ) a += '9' ; } else { for ( int i = a . Length - 1 ; i >= 0 ; i -- ) {