Q. Construct a logical expression to represent each of the following conditions:


(i) Mark is greater than or equal to 100 but less than 70

(ii) Num is between 0 and 5 but not equal to 2

(iii) Answer is either 'N' OR 'n'

(iv) Age is greater than equal to 18 and gender is male.

(v) City is either 'Kolkata' or 'Mumbai'.


Answer :-

(i) Mark >= 100 and Mark < 70
(ii) Num > 0 and Num < 5 and Num != 2
(iii) Answer == 'N' or Answer == 'n'
(iv) Age >= 18 and gender == 'male'
(v) City == 'Kolkata' or City == 'Mumbai'

Post a Comment

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Previous Post Next Post