Computer Science, asked by pallavigupta91, 10 months ago

13. Write a logical expression to represent the following.
(a) Either amount is more than 10 or quantity is less than 5.
(b) Class is '10' and marks is more than 80.​

Answers

Answered by lovingheart
20

Logical expressions to the given statements:

(a)  if((amt>10) or (quantity<5))

{

//necessary statements

}

amt is variable which contains the amount and it needs to be checked whether it is greater than 10 and there needs to be one more condition to check for the value of quantity. The expectation is quantity should be less than 5. If any one of the condition satisfies then statements under if loop will be executed.

(b) if( class = ‘10’ and mark>80)

   {

    }

If condition will be executed if the grade / class is ‘10’ and mark is greater than 80. Both the condition needs to be satisfied to execute if loop.

Similar questions