viewing paste Unknown #27602 | Text

Posted on the
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
Assuming num1 is an int and answer is a double variable, which of the following expressions will always give an accurate, double-precision, answer?
 
(Check all combinations that give double precision accuracy - there will be more than one that should be checked.)
 
        A.     
      answer = (double) ( (num1 + 1.) / 100 );
 
        B.     
      answer = (num1 + 1) / 100 ;
        C.     
      answer =  (num1 + 1) / 100. ;
        D.     
      answer = (double) ( (num1 + 1) / 100 );
        E.     
      answer = ( ( (double)num1 + 1 ) / 100 );
 
Viewed 937 times, submitted by unknown.