Traveersing the string
for ( int i = 0 ; i < num . Length ; i ++ ) { if ( i % 2 != 0 ) { product = product * ( int ) Char . GetNumericValue ( num [ i ] ) ; } else { sum = sum + ( int ) Char . GetNumericValue ( num [ i ] ) ; } } if ( product % sum == 0 ) { return true ; } else { return false ; } }