If a programming language does not use short-circuit evaluation, what is the output of the following code fragment if the value of myInt is 0? int other = 3, myInt; if(myInt != 0 && other % myInt != 0) printf("other is odd\n"); else printf("other is even\n");

Respuesta :

Answer:

other is even.

Step-by-step explanation:

Since the value of myInt variable is assumed to be 0 and we have other =3. In the if condition the expression is true only when the myInt is not equal to zero and and the remainder of other/myInt is not equal to zero (%modulus operator provides the remainder). myInt is 0 hence the expression returns false and the else block is executed so it prints other is even.