107k views
4 votes
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)cout << "other is odd\\";elsecout << "other is even\\";

a.other is even
b.other is odd
c.0
d.run-time error, no output

1 Answer

4 votes

Answer:

Run time error, no output. If myInt = 0 and other is 3, then 3%0 will never occur...apart from that, myInt was neither declared nor initialized

Step-by-step explanation:

User Ephemera
by
4.8k points