InterviewSolution
| 1. |
What Will Be The Outcome Of The Following Conditional Statement If The Value Of Variable S Is 10? |
|
Answer» s >=10 && s < 25 && s!=12 The OUTCOME will be TRUE. SINCE the value of s is 10, s >= 10 evaluates to TRUE because s is not greater than 10 but is STILL equal to 10. s< 25 is also TRUE since 10 is less than 25. Just the same, s! =12, which means s is not equal to 12, evaluates to TRUE. The && is the AND operator, and follows the RULE that if all individual conditions are TRUE, the entire statement is TRUE. s >=10 && s < 25 && s!=12 The outcome will be TRUE. Since the value of s is 10, s >= 10 evaluates to TRUE because s is not greater than 10 but is still equal to 10. s< 25 is also TRUE since 10 is less than 25. Just the same, s! =12, which means s is not equal to 12, evaluates to TRUE. The && is the AND operator, and follows the rule that if all individual conditions are TRUE, the entire statement is TRUE. |
|