Q:

Explain what happens in each of the if tests:

0

Explain what happens in each of the if tests:

if (42 = i) // ... 
if (i = 42) // ...

 

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

`if (42 = i)  // ...` is an error.

`if (i = 42)  // ...` will first assign 42 to `i` and yield the value of `i` as the condition expression of `if` statement. And because 42 is nonzero, the condition will be `true`.

 

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now