Better Students Ask More Questions.
What is a compound conditional expression?
1 Answer | add yours
A basic conditional expression is one in which a particular input variable is tested; the result of the same determines what the value of an output variable is.
For example, consider the expression (x == 4). Here, the variable x is being tested. If it is equal to 4, the condition is true, else it is false.
A compound conditional expression has more than one condition being tested and the the final result is determined with the use of logical OR (||) and AND (&&) operators.
For example : if((x==1) || (x != 4)) is true if either x is equal to 1 or x is not equal to 4. Similarly if((x>1) && (x<6)) is true for values of x lying between 1 and 6.
Posted by justaguide on June 26, 2013 at 2:14 AM (Answer #1)
Related QuestionsSee all »
Join to answer this question
Join a community of thousands of dedicated teachers and students.