viewing paste Unknown #27587 | Text

Posted on the
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
Consider the statement:
 
   if ( (ans == 'Y' || errors < 5)  &&  numTries < 10 )  // note uppercase 'Y'
      count++;
Which combinations of values results in count being incremented after the statement is complete?
 
(Select all that apply.)
 
 
 
 
 
        A.         ans = 'N'
   errors = 5
   numTries = 5
        B.         ans = 'N'
   errors = 3
   numTries = 10
        C.         ans = 'Y'  (upper case)
   errors = 100
   numTries = -1
        D.         ans = 'y'     (lower case)
   errors = 4
   numTries = 5
        E.         ans = 'Y'  (upper case)
   errors = 6
   numTries = 5
 
Viewed 587 times, submitted by unknown.