If the intQuantity and decPrice variables contain the numbers 3 and 15.75, respectively, the condition If intQuantity > 0 AndAlso intQuantity < 10 OrElse decPrice > 20 will evaluate to ____. a.Nob.Yesc.Trued.False

Respuesta :

ijeggs

Answer:

C) True

Explanation:

To see why this evaluates to "True" let's see this line of code in C++

#include <iostream>

using namespace std;

int main()

{

   int intQuantity = 3;

   int decPrice = 15.75;

     if (intQuantity >0 && intQuantity <10 || decPrice>20){

       cout<<"True";

    }

    else{

       cout<<"False";

    }

   return 0;

}

The output from this program will be "True" because the condition  if (intQuantity >0 && intQuantity <10 || decPrice>20) evaluates to true. The reason is because in programming the Logical Or ( | | ) evalutes to true when one or both conditions are true. In the question, although the condition decPrice>20 is not true, the first condition intQuantity >0 && intQuantity <10  is true, so the OR evaluates to true.

ACCESS MORE