• + 0 comments

    Java

    public static long andProduct(long a, long b) {
    // Write your code here
      long result =a;
      long temp;
          for(long i=a+1;i<=b;i++){
              temp=result & i;
              result=temp;
          }
          return result;
    }