if a==10,b=3 then find the value of a=9||b>12 in c language.
Answers
Answered by
2
- If a = 10, b = 3, find the value of a == 9 || b > 12.
- false.
The operator '==' checks whether two values are equal or not and '>' checks whether the first value is greater than the second one.
Here, the value of the variable 'a' is 10. Therefore a == 9 will be false as 'a' is not equal to 9.
→ a == 9 = false — (i)
Again, the value of b is 3. So, b > 12 returns false as b is less than 12.
→ b > 12 = false — (ii)
Now, combine both (i) and (ii),
a == 9 || b > 12
= false || false
In case of 'OR' operator. if any one of the conditions is true, the result is true. But all the conditions is false. Therefore,
→ a == 9 || b > 12 = false.
Logical Operators: It is used to compare two or more relational operations. There are three logical operators:
1. Logical AND.
2. Logical OR.
3. Logical NOR.
Similar questions
English,
3 hours ago
Social Sciences,
3 hours ago
Math,
3 hours ago
Physics,
5 hours ago
English,
5 hours ago
English,
8 months ago
Computer Science,
8 months ago